



import random
import sys

snake_case     :    Optional[Any]						=    'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def 						snake_case__							(       )		->		None:







						"""simple docstring"""

						A__						:				Tuple         =			input("Enter message: "							)
						A__						:				Dict         =			"LFWOAYUISVKMNXPBDCRJTQEGHZ"
						A__						:				int         =			input("Encrypt/Decrypt [e/d]: "							)

						check_valid_key(__lowercase							)

						if resp.lower().startswith("e"							):
												A__						:				Tuple         =			"encrypt"
												A__						:				Union[str, Any]         =			encrypt_message(__lowercase				,  __lowercase							)
						elif resp.lower().startswith("d"							):
												A__						:				Tuple         =			"decrypt"
												A__						:				Tuple         =			decrypt_message(__lowercase				,  __lowercase							)

						print(F'\n{mode.title()}ion: \n{translated}'							)
def 						snake_case__							(       __lowercase							)		->		None:







						"""simple docstring"""

						A__						:				List[Any]         =			list(__lowercase							)
						A__						:				Tuple         =			list(__lowercase							)
						key_list.sort()
						letters_list.sort()

						if key_list != letters_list:
												sys.exit("Error in the key or symbol set."							)
def 						snake_case__							(       __lowercase				,  __lowercase							)		->		str:







						"""simple docstring"""

						return translate_message(__lowercase				,  __lowercase				,  "encrypt"							)
def 						snake_case__							(       __lowercase				,  __lowercase							)		->		str:







						"""simple docstring"""

						return translate_message(__lowercase				,  __lowercase				,  "decrypt"							)
def 						snake_case__							(       __lowercase				,  __lowercase				,  __lowercase							)		->		str:







						"""simple docstring"""

						A__						:				Optional[Any]         =			""
						A__						:				int         =			LETTERS
						A__						:				int         =			key

						if mode == "decrypt":
												A__     ,							A__						:				str         =			chars_b, chars_a

						for symbol in message:
												if symbol.upper() in chars_a:
																		A__						:				List[str]         =			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__							(       )		->		str:







						"""simple docstring"""

						A__						:				Tuple         =			list(__lowercase							)
						random.shuffle(__lowercase							)
						return "".join(__lowercase							)


if __name__ == "__main__":
		main()




def 						snake_case__							(       __lowercase = 1_0_0_0							)		->		int:







						"""simple docstring"""

						A__						:				int         =			0
						A__						:				Optional[int]         =			0
						while 1:
												num += 3
												if num >= n:
																		break
												total += num
												num += 2
												if num >= n:
																		break
												total += num
												num += 1
												if num >= n:
																		break
												total += num
												num += 3
												if num >= n:
																		break
												total += num
												num += 1
												if num >= n:
																		break
												total += num
												num += 2
												if num >= n:
																		break
												total += num
												num += 3
												if num >= n:
																		break
												total += num
						return total


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