



'''simple docstring'''



from __future__ import annotations


def 							__UpperCAmelCase				(				UpperCamelCase__				:int			)		->						list[int]:
				snake_case__      :   Any      =    [0] * max_one

				for i in range(0   ,				UpperCamelCase__			):
								snake_case__      :   str      =    i

				for i in range(2   ,				UpperCamelCase__			):
								if totients[i] == i:
												for j in range(UpperCamelCase__   ,				UpperCamelCase__   ,				UpperCamelCase__			):
																totients[j] -= totients[j] // i

				return totients


def 							__UpperCAmelCase				(				UpperCamelCase__				:int   ,				UpperCamelCase__				:int			)		->						bool:
				return sorted(str(UpperCamelCase__			)			) == sorted(str(UpperCamelCase__			)			)


def 							__UpperCAmelCase				(				UpperCamelCase__				:int = 1000_0000			)		->						int:
				snake_case__      :   int      =    1  # i
				snake_case__      :   List[Any]      =    0  # φ(i)
				snake_case__      :   List[str]      =    get_totients(max_n + 1			)

				for i in range(2   ,				max_n + 1			):
								snake_case__      :   Optional[int]      =    totients[i]

								if i * min_denominator < min_numerator * t and has_same_digits(UpperCamelCase__   ,				UpperCamelCase__			):
												snake_case__      :   List[Any]      =    i
												snake_case__      :   Optional[int]      =    t

				return min_numerator


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









'''simple docstring'''





def     UpperCAmelCase     (    a_ = 9_9_8_0_0_1		)   ->       int:



   """simple docstring"""






   for number in range(n - 1      ,		9_9_9_9      ,		-1		):
      A_  :		Optional[Any]						=					str(a_		)

      # checks whether 'str_number' is a palindrome.
      if str_number == str_number[::-1]:
         A_  :		int						=					9_9_9

         # if 'number' is a product of two 3-digit numbers
         # then number is the answer otherwise fetch next number.
         while divisor != 9_9:
            if (number % divisor == 0) and (len(str(number // divisor		)		) == 3.0):
               return number
            divisor -= 1
   raise ValueError("""That number is larger than our acceptable range."""		)


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