





"""simple docstring"""




from __future__ import annotations





def 		UpperCAmelCase__						(	_UpperCAmelCase   ):






  """simple docstring"""





  A_    :			Union[str, Any]									=    [0] * max_one

  for i in range(0					,   _UpperCAmelCase   ):
    A_    :			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					,   _UpperCAmelCase   ):






  """simple docstring"""





  return sorted(str(_UpperCAmelCase   )   ) == sorted(str(_UpperCAmelCase   )   )





def 		UpperCAmelCase__						(	_UpperCAmelCase = 10000000   ):






  """simple docstring"""





  A_    :			Any									=    1  # i
  A_    :			Optional[Any]									=    0  # φ(i)
  A_    :			Any									=    get_totients(max_n + 1   )

  for i in range(2					,   max_n + 1   ):
    A_    :			str									=    totients[i]

    if i * min_denominator < min_numerator * t and has_same_digits(_UpperCAmelCase					,   _UpperCAmelCase   ):
      A_    :			Tuple									=    i
      A_    :			Union[str, Any]									=    t

  return min_numerator


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

def 			UpperCamelCase       (				lowerCAmelCase__ = 30						):
					'''simple docstring'''
					lowercase		      =		exponent + 2
					lowercase		      =		(1 + 5**0.5) / 2
					lowercase		      =		(phi**fibonacci_index - (phi - 1) ** fibonacci_index) / 5**0.5

					return int(lowerCAmelCase__						)


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




