






'''simple docstring'''
def 	_a(					UpperCamelCase__			:  Optional[int]							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			List[Any]													=[0] * len(UpperCamelCase__							)
      SCREAMING_SNAKE_CASE__       :			Any													=[]
      SCREAMING_SNAKE_CASE__       :			Tuple													=[1] * len(UpperCamelCase__							)

      for values in graph.values():
            for i in values:
                  indegree[i] += 1

      for i in range(len(UpperCamelCase__							)							):
            if indegree[i] == 0:
                  queue.append(UpperCamelCase__							)

      while queue:
            SCREAMING_SNAKE_CASE__       :			Tuple													=queue.pop(0							)
            for x in graph[vertex]:
                  indegree[x] -= 1

                  if long_dist[vertex] + 1 > long_dist[x]:
                        SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=long_dist[vertex] + 1

                  if indegree[x] == 0:
                        queue.append(UpperCamelCase__							)

      print(max(UpperCamelCase__							)							)


# Adjacency list of Graph
a_					=	{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}







longest_distance(graph)







'''simple docstring'''
import math





def 	_a(					UpperCamelCase__			:  int							):




      '''simple docstring'''






      return math.sqrt(UpperCamelCase__							) * math.sqrt(UpperCamelCase__							) == num





def 	_a(					UpperCamelCase__			:  int							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			List[Any]													=0
      SCREAMING_SNAKE_CASE__       :			Any													=n
      while left <= right:
            SCREAMING_SNAKE_CASE__       :			str													=(left + right) // 2
            if mid**2 == n:
                  return True
            elif mid**2 > n:
                  SCREAMING_SNAKE_CASE__       :			Optional[Any]													=mid - 1
            else:
                  SCREAMING_SNAKE_CASE__       :			Tuple													=mid + 1
      return False


if __name__ == "__main__":
  import doctest

  doctest.testmod()