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() = }''')







"""simple docstring"""




SCREAMING_SNAKE_CASE_  :      Optional[int]							=      {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]}

SCREAMING_SNAKE_CASE_  :      str							=      {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []}



def 						UpperCAmelCase__ (					A__						,     A__						,     A__ )   ->   list:




   """simple docstring"""
   lowerCamelCase__						       =      True
   lowerCamelCase__						       =      []

   for neighbour in graph[vert]:
      if not visited[neighbour]:
         connected_verts += dfs(A__						,     A__						,     A__ )

   return [vert, *connected_verts]



def 						UpperCAmelCase__ (					A__ )   ->   list:




   """simple docstring"""
   lowerCamelCase__						       =      len(A__ )
   lowerCamelCase__						       =      graph_size * [False]
   lowerCamelCase__						       =      []

   for i in range(A__ ):
      if not visited[i]:
         lowerCamelCase__						       =      dfs(A__						,     A__						,     A__ )
         components_list.append(A__ )

   return components_list


if __name__ == "__main__":
     import doctest

     doctest.testmod()




