




'''simple docstring'''





# Lint as: python3
import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


_SCREAMING_SNAKE_CASE							:       List[Any]						=			re.compile(r"^(?P<major>\d+)" r"\.(?P<minor>\d+)" r"\.(?P<patch>\d+)$")




@total_ordering
@dataclass
class 			_snake_case		:
			lowerCAmelCase_					:				str
			lowerCAmelCase_					:				Optional[str]							=   None
			lowerCAmelCase_					:				Optional[Union[str, int]]							=   None
			lowerCAmelCase_					:				Optional[Union[str, int]]							=   None
			lowerCAmelCase_					:				Optional[Union[str, int]]							=   None




			def        lowerCAmelCase__    ( self							)    ->    int:

										'''simple docstring'''




										snake_case_ ,				snake_case_ ,				snake_case_      =				_str_to_version_tuple(self.version_str							)




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

										'''simple docstring'''




										return F'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'




			@property
			def        lowerCAmelCase__    ( self							)    ->    Any:

										'''simple docstring'''




										return self.major, self.minor, self.patch




			def        lowerCAmelCase__    ( self    ,							a__							)    ->    Any:

										'''simple docstring'''




										if isinstance(a__    ,							a__							):
																	return Version(a__							)
										elif isinstance(a__    ,							a__							):
																	return other
										raise TypeError(F'{other} (type {type(a__							)}) cannot be compared to version.'							)




			def __eq__( self    ,							a__							)    ->    int:

										'''simple docstring'''




										try:
																	snake_case_      =				self._validate_operand(a__							)
										except (TypeError, ValueError):
																	return False
										else:
																	return self.tuple == other.tuple




			def __lt__( self    ,							a__							)    ->    Tuple:

										'''simple docstring'''




										snake_case_      =				self._validate_operand(a__							)
										return self.tuple < other.tuple




			def __hash__( self							)    ->    Dict:

										'''simple docstring'''




										return hash(_version_tuple_to_str(self.tuple							)							)




			@classmethod
			def        lowerCAmelCase__    ( cls    ,							a__							)    ->    List[Any]:

										'''simple docstring'''




										snake_case_      =				{f.name for f in dataclasses.fields(cls							)}
										return cls(**{k: v for k, v in dic.items() if k in field_names}							)




			def        lowerCAmelCase__    ( self							)    ->    str:

										'''simple docstring'''




										return self.version_str


def 					UpperCamelCase_(     snake_case							:	Optional[int]					):

							'''simple docstring'''






							snake_case_      =				_VERSION_REG.match(snake_case					)
							if not res:
														raise ValueError(f'Invalid version \'{version_str}\'. Format should be x.y.z with {{x,y,z}} being digits.'					)
							return tuple(int(snake_case					) for v in [res.group("major"					), res.group("minor"					), res.group("patch"					)]					)




def 					UpperCamelCase_(     snake_case							:	Optional[Any]					):

							'''simple docstring'''






							return ".".join(str(snake_case					) for v in version_tuple					)










'''simple docstring'''





def 					UpperCamelCase_(     snake_case							:	int							,    snake_case							:	int					):

							'''simple docstring'''






							while b:
														snake_case_ ,				snake_case_      =				b, a % b
							return a


def 					UpperCamelCase_(     snake_case							:	int							,    snake_case							:	int					):

							'''simple docstring'''






							return a if b == 0 else euclidean_gcd_recursive(snake_case							,    a % b					)


def 					UpperCamelCase_(     ):

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




