from __future__ import annotations

def 	__lowerCamelCase							(				__a    : int		)      ->       list[int]:
	_lowercase   =[0] * max_one

	for i in range(0      ,							__a		):
		_lowercase   =i

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

	return totients

def 	__lowerCamelCase							(				__a    : int      ,							__a    : int		)      ->       bool:
	return sorted(str(__a		)		) == sorted(str(__a		)		)

def 	__lowerCamelCase							(				__a    : int = 10_000_000		)      ->       int:
	_lowercase   =1  # i
	_lowercase   =0  # φ(i)
	_lowercase   =get_totients(max_n + 1		)

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

		if i * min_denominator < min_numerator * t and has_same_digits(__a      ,							__a		):
			_lowercase   =i
			_lowercase   =t

	return min_numerator


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





import math
from timeit import timeit







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    __snake_case       :				Optional[Any] 			=    0
    __snake_case       :				Union[str, Any] 			=    abs(__SCREAMING_SNAKE_CASE   )
    while True:
        __snake_case       :				List[str] 			=    n // 1_0
        digits += 1
        if n == 0:
            break
    return digits







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    return 1 if n == 0 else math.floor(math.log(abs(__SCREAMING_SNAKE_CASE   )		,							1_0   ) + 1   )







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    return len(str(abs(__SCREAMING_SNAKE_CASE   )   )   )







def 					__lowerCAmelCase				(		):







    '''simple docstring'''
    from collections.abc import Callable

    def benchmark_a_function(__SCREAMING_SNAKE_CASE       :					Callable		,							__SCREAMING_SNAKE_CASE       :					int   ) -> None:
        __snake_case       :				Tuple 			=    F'''{func.__name__}({value})'''
        __snake_case       :				Union[str, Any] 			=    timeit(F'''__main__.{call}'''		,							setup="""import __main__"""   )
        print(F'''{call}: {func(__SCREAMING_SNAKE_CASE   )} -- {timing} seconds'''   )

    for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
        for func in (num_digits, num_digits_fast, num_digits_faster):
            benchmark_a_function(__SCREAMING_SNAKE_CASE		,							__SCREAMING_SNAKE_CASE   )
        print()


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     benchmark()



