
'''simple docstring'''



import random
import sys

_lowercase					    =		"""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""


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

						check_valid_key(__lowerCamelCase		)

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

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


def A      (__lowerCamelCase      :str		):
						_lowerCAmelCase  						= list(__lowerCamelCase		)
						_lowerCAmelCase  						= list(__lowerCamelCase		)
						key_list.sort()
						letters_list.sort()

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


def A      (__lowerCamelCase      :str ,	__lowerCamelCase      :str		):
						return translate_message(__lowerCamelCase ,	__lowerCamelCase ,	"""encrypt"""		)


def A      (__lowerCamelCase      :str ,	__lowerCamelCase      :str		):
						return translate_message(__lowerCamelCase ,	__lowerCamelCase ,	"""decrypt"""		)


def A      (__lowerCamelCase      :str ,	__lowerCamelCase      :str ,	__lowerCamelCase      :str		):
						_lowerCAmelCase  						= ""
						_lowerCAmelCase  						= LETTERS
						_lowerCAmelCase  						= key

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

						for symbol in message:
												if symbol.upper() in chars_a:
																		_lowerCAmelCase  						= 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 A      ():
						_lowerCAmelCase  						= list(__lowerCamelCase		)
						random.shuffle(__lowerCamelCase		)
						return "".join(__lowerCamelCase		)


if __name__ == "__main__":
						main()



from hashlib import mda, shaaaa

SCREAMING_SNAKE_CASE_						=					(shaaaa, mda)

class  a     :


						def __init__(				self  ,    A_ = 8		):







										'''simple docstring'''


										_UpperCAmelCase				:						Any       						=			0B0
										_UpperCAmelCase				:						Optional[Any]       						=			size


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Optional[Any]       						=			self.hash_(A_		)
										self.bitarray |= h


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						int       						=			self.hash_(A_		)
										return (h & self.bitarray) == h


						def __contains__(				self  ,    A_		):







										'''simple docstring'''


										return self.exists(A_		)


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Optional[int]       						=			bin(A_		)[2:]
										return res.zfill(self.size		)


						@property
						def 				_UpperCAmelCase (				self		):







										'''simple docstring'''


										return self.format_bin(self.bitarray		)


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Union[str, Any]       						=			0B0
										for func in HASH_FUNCTIONS:
														_UpperCAmelCase				:						str       						=			(
														    int.from_bytes(func(value.encode()		).digest()  ,    "little"		) % self.size
														)
														res |= 2**position
										return res


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										return self.format_bin(self.hash_(A_		)		)





						@property
						def 				_UpperCAmelCase (				self		):







										'''simple docstring'''


										_UpperCAmelCase				:						Union[str, Any]       						=			bin(self.bitarray		).count("1"		)
										return (n_ones / self.size) ** len(A_		)


