






A_		:		List[Any]		     =			{0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

A_		:		Union[str, Any]		     =			{0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}

def   snake_case (UpperCAmelCase__     ,   UpperCAmelCase__     ,   UpperCAmelCase__  )	->    list[int]:
  UpperCamelCase_: Optional[int]   				=    True
  UpperCamelCase_: int   				=    []

  for neighbour in graph[vert]:
    if not visited[neighbour]:
      order += topology_sort(UpperCAmelCase__     ,   UpperCAmelCase__     ,   UpperCAmelCase__  )

  order.append(UpperCAmelCase__  )

  return order

def   snake_case (UpperCAmelCase__     ,   UpperCAmelCase__     ,   UpperCAmelCase__  )	->    list[int]:
  UpperCamelCase_: List[str]   				=    True
  UpperCamelCase_: Optional[int]   				=    [vert]

  for neighbour in reversed_graph[vert]:
    if not visited[neighbour]:
      component += find_components(UpperCAmelCase__     ,   UpperCAmelCase__     ,   UpperCAmelCase__  )

  return component

def   snake_case (UpperCAmelCase__  )	->    list[list[int]]:
  UpperCamelCase_: Tuple   				=    len(UpperCAmelCase__  ) * [False]
  UpperCamelCase_: dict[int, list[int]]   				=    {vert: [] for vert in range(len(UpperCAmelCase__  )  )}

  for vert, neighbours in graph.items():
    for neighbour in neighbours:
      reversed_graph[neighbour].append(UpperCAmelCase__  )

  UpperCamelCase_: int   				=    []
  for i, was_visited in enumerate(UpperCAmelCase__  ):
    if not was_visited:
      order += topology_sort(UpperCAmelCase__     ,   UpperCAmelCase__     ,   UpperCAmelCase__  )

  UpperCamelCase_: str   				=    []
  UpperCamelCase_: str   				=    len(UpperCAmelCase__  ) * [False]

  for i in range(len(UpperCAmelCase__  )  ):
    UpperCamelCase_: Optional[int]   				=    order[len(UpperCAmelCase__  ) - i - 1]
    if not visited[vert]:
      UpperCamelCase_: str   				=    find_components(UpperCAmelCase__     ,   UpperCAmelCase__     ,   UpperCAmelCase__  )
      components_list.append(UpperCAmelCase__  )

  return components_list







def   snake_case (UpperCAmelCase__     ,   UpperCAmelCase__  )	->    int:
  while b:
    UpperCamelCase_				,UpperCamelCase_: int   				=    b, a % b
  return a

def   snake_case (UpperCAmelCase__     ,   UpperCAmelCase__  )	->    int:
  return a if b == 0 else euclidean_gcd_recursive(UpperCAmelCase__     ,   a % b  )

def   snake_case ()	->    int:
  print(F'''euclidean_gcd(3, 5) = {euclidean_gcd(3     ,   5  )}'''  )
  print(F'''euclidean_gcd(5, 3) = {euclidean_gcd(5     ,   3  )}'''  )
  print(F'''euclidean_gcd(1, 3) = {euclidean_gcd(1     ,   3  )}'''  )
  print(F'''euclidean_gcd(3, 6) = {euclidean_gcd(3     ,   6  )}'''  )
  print(F'''euclidean_gcd(6, 3) = {euclidean_gcd(6     ,   3  )}'''  )

  print(F'''euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3     ,   5  )}'''  )
  print(F'''euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5     ,   3  )}'''  )
  print(F'''euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1     ,   3  )}'''  )
  print(F'''euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3     ,   6  )}'''  )
  print(F'''euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6     ,   3  )}'''  )


if __name__ == "__main__":
   main()