
"""simple docstring"""





def 	__a     (		__lowerCamelCase,		__lowerCamelCase  ):
   while b:
      UpperCAmelCase_     ,   UpperCAmelCase_					:					Dict			     =    b, a % b
   return a







def 	__a     (		__lowerCamelCase,		__lowerCamelCase  ):
   return a if b == 0 else euclidean_gcd_recursive(__lowerCamelCase,		a % b  )







def 	__a     (		):
   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()




"""simple docstring"""





from __future__ import annotations







def 	__a     (		__lowerCamelCase,		__lowerCamelCase  ):
   UpperCAmelCase_     ,   UpperCAmelCase_					:					str			     =    set(__lowerCamelCase  ), [start]

   while stack:
      UpperCAmelCase_					:					Any			     =    stack.pop()
      explored.add(__lowerCamelCase  )
      # Differences from BFS:
      # 1) pop last element instead of first one
      # 2) add adjacent elements to stack without exploring them
      for adj in reversed(graph[v]  ):
         if adj not in explored:
            stack.append(__lowerCamelCase  )
   return explored


_a		       =							{
    'A': ['B', 'C', 'D'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F'],
    'D': ['B', 'D'],
    'E': ['B', 'F'],
    'F': ['C', 'E', 'G'],
    'G': ['F'],
}

if __name__ == "__main__":
    import doctest

    doctest.testmod()
    print(depth_first_search(G, 'A'))


