
"""simple docstring"""




from __future__ import annotations

from collections.abc import Iterator
from typing import Generic, TypeVar

UpperCAmelCase__ :       Any       				=					TypeVar('T')



class       lowerCAmelCase_		(Generic[T]    ):


				"""simple docstring"""



				def __init__(self  ,			SCREAMING_SNAKE_CASE__       )   ->						List[str]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		:			List[str]	 =  data
											SCREAMING_SNAKE_CASE__		:			Node[T] | None	 =  None



				def __str__(self       )   ->						str:



											"""simple docstring"""




											return F'''{self.data}'''






class       lowerCAmelCase_		(Generic[T]    ):


				"""simple docstring"""



				def __init__(self       )   ->						Any:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		:			Node[T] | None	 =  None



				def __iter__(self       )   ->						List[str]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		:			Optional[Any]	 =  self.top
											while node:
																		yield node.data
																		SCREAMING_SNAKE_CASE__		:			Dict	 =  node.next



				def __str__(self       )   ->						Any:



											"""simple docstring"""




											return "->".join([str(_lowerCamelCase       ) for item in self]       )



				def __len__(self       )   ->						int:



											"""simple docstring"""




											return len(tuple(iter(self       )       )       )



				def       __magic_name__       (self       )   ->						int:



											"""simple docstring"""




											return self.top is None



				def       __magic_name__       (self  ,			SCREAMING_SNAKE_CASE__       )   ->						List[str]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		:			Any	 =  Node(_lowerCamelCase       )
											if not self.is_empty():
																		SCREAMING_SNAKE_CASE__		:			Any	 =  self.top
											SCREAMING_SNAKE_CASE__		:			List[str]	 =  node



				def       __magic_name__       (self       )   ->						List[Any]:



											"""simple docstring"""




											if self.is_empty():
																		raise IndexError("""pop from empty stack"""       )
											assert isinstance(self.top  ,			_lowerCamelCase       )
											SCREAMING_SNAKE_CASE__		:			Tuple	 =  self.top
											SCREAMING_SNAKE_CASE__		:			int	 =  self.top.next
											return pop_node.data



				def       __magic_name__       (self       )   ->						Optional[Any]:



											"""simple docstring"""




											if self.is_empty():
																		raise IndexError("""peek from empty stack"""       )

											assert self.top is not None
											return self.top.data



				def       __magic_name__       (self       )   ->						int:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		:			str	 =  None


if __name__ == "__main__":
					from doctest import testmod

					testmod()








def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





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




      """simple docstring"""





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




      """simple docstring"""





      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()





