

from __future__ import annotations

from collections.abc import Iterator
from typing import Any







class 						lowercase     :


		"""simple docstring"""




		def __init__(					self						,							__snake_case):
			_UpperCamelCase :		Any								=    data
			_UpperCamelCase :		Node | None								=    None






		def __str__(					self):
			return f'''{self.data}'''







class 						lowercase     :


		"""simple docstring"""




		def __init__(					self):
			_UpperCamelCase :		Node | None								=    None
			_UpperCamelCase :		Node | None								=    None


		def __iter__(					self):
			_UpperCamelCase :		List[str]								=    self.front
			while node:
				yield node.data
				_UpperCamelCase :		Optional[Any]								=    node.next


		def __len__(					self):
			return len(tuple(iter(self)))


		def __str__(					self):
			return " <- ".join(str(__snake_case) for item in self)


		def 		A__       (					self):
			return len(self) == 0


		def 		A__       (					self						,							__snake_case):
			_UpperCamelCase :		str								=    Node(__snake_case)
			if self.is_empty():
				_UpperCamelCase :		Tuple								=    node
			else:
				assert isinstance(self.rear						,							__snake_case)
				_UpperCamelCase :		List[str]								=    node
				_UpperCamelCase :		Optional[Any]								=    node


		def 		A__       (					self):
			if self.is_empty():
				raise IndexError('dequeue from empty queue')
			assert isinstance(self.front						,							__snake_case)
			_UpperCamelCase :		List[Any]								=    self.front
			_UpperCamelCase :		str								=    self.front.next
			if self.front is None:
				_UpperCamelCase :		int								=    None
			return node.data






		def 		A__       (					self):
			_UpperCamelCase :		Tuple								=    None


if __name__ == "__main__":
							from doctest import testmod

							testmod()







from __future__ import annotations






def        lowerCamelCase_  (				UpperCAmelCase_				:  int						)    ->					list[int]:




	'''simple docstring'''




	_UpperCamelCase :		Any								=    [0] * max_one

	for i in range(0				,							UpperCAmelCase_						):
		_UpperCamelCase :		List[Any]								=    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        lowerCamelCase_  (				UpperCAmelCase_				:  int				,							UpperCAmelCase_				:  int						)    ->					bool:




	'''simple docstring'''




	return sorted(str(UpperCAmelCase_						)						) == sorted(str(UpperCAmelCase_						)						)






def        lowerCamelCase_  (				UpperCAmelCase_				:  int = 1_0_0_0_0_0_0_0						)    ->					int:




	'''simple docstring'''




	_UpperCamelCase :		List[Any]								=    1  # i
	_UpperCamelCase :		List[str]								=    0  # φ(i)
	_UpperCamelCase :		str								=    get_totients(max_n + 1						)

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

		if i * min_denominator < min_numerator * t and has_same_digits(UpperCAmelCase_				,							UpperCAmelCase_						):
			_UpperCamelCase :		Optional[int]								=    i
			_UpperCamelCase :		Tuple								=    t

	return min_numerator


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




