


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


_A		       =						re.compile(R'^(?P<major>\d+)' R'\.(?P<minor>\d+)' R'\.(?P<patch>\d+)$')






@total_ordering
@dataclass
class     UpperCAmelCase__       :



    """simple docstring"""






    UpperCAmelCase__						:		str
    UpperCAmelCase__						:		Optional[str]      =  None
    UpperCAmelCase__						:		Optional[Union[str, int]]      =  None
    UpperCAmelCase__						:		Optional[Union[str, int]]      =  None
    UpperCAmelCase__						:		Optional[Union[str, int]]      =  None






    def _a					(			self    )  ->       Dict:
         __UpperCamelCase							,      __UpperCamelCase							,      __UpperCamelCase    							=_str_to_version_tuple(self.version_str    )






    def __repr__(			self    )  ->       List[Any]:
         return f'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'






    @property
    def _a					(			self    )  ->       List[str]:
         return self.major, self.minor, self.patch






    def _a					(			self					,   A_    )  ->       Optional[Any]:
         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_    )  ->       Union[str, Any]:
         try:
              __UpperCamelCase    							=self._validate_operand(A_    )
         except (TypeError, ValueError):
              return False
         else:
              return self.tuple == other.tuple






    def __lt__(			self					,   A_    )  ->       Optional[int]:
         __UpperCamelCase    							=self._validate_operand(A_    )
         return self.tuple < other.tuple






    def __hash__(			self    )  ->       Optional[Any]:
         return hash(_version_tuple_to_str(self.tuple    )    )






    @classmethod
    def _a					(			cls					,   A_    )  ->       Tuple:
         __UpperCamelCase    							={f.name for f in dataclasses.fields(cls    )}
         return cls(**{k: v for k, v in dic.items() if k in field_names}    )






    def _a					(			self    )  ->       str:
         return self.version_str

def 						_UpperCAmelCase				(			SCREAMING_SNAKE_CASE__			:					int				):
     __UpperCamelCase    							=_VERSION_REG.match(SCREAMING_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(SCREAMING_SNAKE_CASE__				) for v in [res.group('major'				), res.group('minor'				), res.group('patch'				)]				)





def 						_UpperCAmelCase				(			SCREAMING_SNAKE_CASE__			:					List[Any]				):
     return ".".join(str(SCREAMING_SNAKE_CASE__				) for v in version_tuple				)











from __future__ import annotations


def 						lowerCamelCase__    (		_A							):







	'''simple docstring'''





	snake_case_		    =     str(_A							)
	return len(_A							) == 9 and set(_A							) == set("123456789"							)


def 						lowerCamelCase__    (		):







	'''simple docstring'''





	for base_num in range(9999     ,	4999     ,	-1							):
		snake_case_		    =     100002 * base_num
		if is_9_pandigital(_A							):
			return candidate

	for base_num in range(333     ,	99     ,	-1							):
		snake_case_		    =     1002003 * base_num
		if is_9_pandigital(_A							):
			return candidate

	return None


if __name__ == "__main__":
		print(f'''{solution() = }''')
