


'''simple docstring'''
from __future__ import annotations




def      __snake_case       (       lowerCamelCase_ :				int						):
				'''simple docstring'''




				__magic_name__	  = [0] * max_one

				for i in range(0	,  lowerCamelCase_						):
								__magic_name__	  = 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      __snake_case       (       lowerCamelCase_ :				int	,  lowerCamelCase_ :				int						):
				'''simple docstring'''




				return sorted(str(lowerCamelCase_						)						) == sorted(str(lowerCamelCase_						)						)




def      __snake_case       (       lowerCamelCase_ :				int = 1000_0000						):
				'''simple docstring'''




				__magic_name__	  = 1  # i
				__magic_name__	  = 0  # φ(i)
				__magic_name__	  = get_totients(max_n + 1						)

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

								if i * min_denominator < min_numerator * t and has_same_digits(lowerCamelCase_	,  lowerCamelCase_						):
												__magic_name__	  = i
												__magic_name__	  = t

				return min_numerator


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







'''simple docstring'''
import random
import sys

__magic_name__   :   Optional[Any]  							='ABCDEFGHIJKLMNOPQRSTUVWXYZ'




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = input("Enter message: "						)
				__magic_name__	  = "LFWOAYUISVKMNXPBDCRJTQEGHZ"
				__magic_name__	  = input("Encrypt/Decrypt [e/d]: "						)

				check_valid_key(lowerCamelCase_						)

				if resp.lower().startswith("e"						):
								__magic_name__	  = "encrypt"
								__magic_name__	  = encrypt_message(lowerCamelCase_	,  lowerCamelCase_						)
				elif resp.lower().startswith("d"						):
								__magic_name__	  = "decrypt"
								__magic_name__	  = decrypt_message(lowerCamelCase_	,  lowerCamelCase_						)

				print(F'\n{mode.title()}ion: \n{translated}'						)




def      __snake_case       (       lowerCamelCase_ :				str						):
				'''simple docstring'''




				__magic_name__	  = list(lowerCamelCase_						)
				__magic_name__	  = list(lowerCamelCase_						)
				key_list.sort()
				letters_list.sort()

				if key_list != letters_list:
								sys.exit("Error in the key or symbol set."						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				return translate_message(lowerCamelCase_	,  lowerCamelCase_	,  "encrypt"						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				return translate_message(lowerCamelCase_	,  lowerCamelCase_	,  "decrypt"						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				__magic_name__	  = ""
				__magic_name__	  = LETTERS
				__magic_name__	  = key

				if mode == "decrypt":
								__magic_name__  ,      __magic_name__	  = chars_b, chars_a

				for symbol in message:
								if symbol.upper() in chars_a:
												__magic_name__	  = chars_a.find(symbol.upper()						)
												if symbol.isupper():
																translated += chars_b[sym_index].upper()
												else:
																translated += chars_b[sym_index].lower()
								else:
												translated += symbol

				return translated




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = list(lowerCamelCase_						)
				random.shuffle(lowerCamelCase_						)
				return "".join(lowerCamelCase_						)


if __name__ == "__main__":
						main()



