






from __future__ import annotations




def       _a   (							lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)  ->      int | float:
 if len(lowerCamelCase__				) == 0:
  raise ValueError('find_min() arg is an empty sequence'				)
 if (
     left >= len(lowerCamelCase__				)
     or left < -len(lowerCamelCase__				)
     or right >= len(lowerCamelCase__				)
     or right < -len(lowerCamelCase__				)
 ):
  raise IndexError('list index out of range'				)
 if left == right:
  return nums[left]
 lowerCamelCase_							:    Any							=     (left + right) >> 1  # the middle
 lowerCamelCase_							:    str							=     find_min(lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)  # find min in range[left, mid]
 lowerCamelCase_							:    int							=     find_min(lowerCamelCase__ ,			mid + 1 ,			lowerCamelCase__				)  # find min in range[mid + 1, right]

 return left_min if left_min <= right_min else right_min


if __name__ == "__main__":
       import doctest

       doctest.testmod(verbose=True)








from __future__ import annotations




def       _a   (							lowerCamelCase__				)  ->      list[int]:
 lowerCamelCase_							:    Any							=     [0] * max_one

 for i in range(0 ,			lowerCamelCase__				):
  lowerCamelCase_							:    Union[str, Any]							=     i

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

 return totients




def       _a   (							lowerCamelCase__ ,			lowerCamelCase__				)  ->      bool:
 return sorted(str(lowerCamelCase__				)				) == sorted(str(lowerCamelCase__				)				)




def       _a   (							lowerCamelCase__ = 10_00_00_00				)  ->      int:
 lowerCamelCase_							:    Tuple							=     1  # i
 lowerCamelCase_							:    Union[str, Any]							=     0  # φ(i)
 lowerCamelCase_							:    List[Any]							=     get_totients(max_n + 1				)

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

  if i * min_denominator < min_numerator * t and has_same_digits(lowerCamelCase__ ,			lowerCamelCase__				):
   lowerCamelCase_							:    str							=     i
   lowerCamelCase_							:    List[Any]							=     t

 return min_numerator


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