






def        _SCREAMING_SNAKE_CASE  (				A  :       Any  )    -> int:







   """simple docstring"""
   __snake_case				:      Any     							= [0] * len(A  )
   __snake_case				:      List[str]     							= []
   __snake_case				:      List[str]     							= [1] * len(A  )

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

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

   while queue:
      __snake_case				:      Optional[Any]     							= queue.pop(0  )
      for x in graph[vertex]:
         indegree[x] -= 1

         if long_dist[vertex] + 1 > long_dist[x]:
            __snake_case				:      int     							= long_dist[vertex] + 1

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

   print(max(A  )  )


# 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'''






from functools import lru_cache




@lru_cache
def        _SCREAMING_SNAKE_CASE  (				A  :       int  )    -> int:







   """simple docstring"""
   if num < 0:
      raise ValueError('Number should not be negative.'  )

   return 1 if num in (0, 1) else num * factorial(num - 1  )


if __name__ == "__main__":
      import doctest

      doctest.testmod()