

import random
import sys

SCREAMING_SNAKE_CASE_						=					'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def 							__SCREAMING_SNAKE_CASE							( )      ->				None:
				_UpperCAmelCase				:						Optional[int]       						=			input("Enter message: "       )
				_UpperCAmelCase				:						Optional[Any]       						=			"LFWOAYUISVKMNXPBDCRJTQEGHZ"
				_UpperCAmelCase				:						Optional[int]       						=			input("Encrypt/Decrypt [e/d]: "       )

				check_valid_key(lowerCAmelCase       )

				if resp.lower().startswith("e"       ):
								_UpperCAmelCase				:						int       						=			"encrypt"
								_UpperCAmelCase				:						Optional[int]       						=			encrypt_message(lowerCAmelCase     ,					lowerCAmelCase       )
				elif resp.lower().startswith("d"       ):
								_UpperCAmelCase				:						List[Any]       						=			"decrypt"
								_UpperCAmelCase				:						Tuple       						=			decrypt_message(lowerCAmelCase     ,					lowerCAmelCase       )

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

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     str       )      ->				None:
				_UpperCAmelCase				:						str       						=			list(lowerCAmelCase       )
				_UpperCAmelCase				:						Optional[int]       						=			list(lowerCAmelCase       )
				key_list.sort()
				letters_list.sort()

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

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     str     ,					lowerCAmelCase:     str       )      ->				str:
				return translate_message(lowerCAmelCase     ,					lowerCAmelCase     ,					"encrypt"       )

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     str     ,					lowerCAmelCase:     str       )      ->				str:
				return translate_message(lowerCAmelCase     ,					lowerCAmelCase     ,					"decrypt"       )

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     str     ,					lowerCAmelCase:     str     ,					lowerCAmelCase:     str       )      ->				str:
				_UpperCAmelCase				:						Tuple       						=			""
				_UpperCAmelCase				:						List[Any]       						=			LETTERS
				_UpperCAmelCase				:						Optional[int]       						=			key

				if mode == "decrypt":
								_UpperCAmelCase						,							_UpperCAmelCase				:						Union[str, Any]       						=			chars_b, chars_a

				for symbol in message:
								if symbol.upper() in chars_a:
												_UpperCAmelCase				:						Tuple       						=			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 							__SCREAMING_SNAKE_CASE							( )      ->				str:
				_UpperCAmelCase				:						Optional[int]       						=			list(lowerCAmelCase       )
				random.shuffle(lowerCAmelCase       )
				return "".join(lowerCAmelCase       )


if __name__ == "__main__":
					main()






'''simple docstring'''







import math






def       lowerCAmelCase__       (				lowerCamelCase     :			int   ):
       _A     :	int      =					math.log(2  ,10   ) * number
       _A     :	List[Any]      =					round((log_number - int(lowerCamelCase   ))  ,15   )

       return difference






def       lowerCAmelCase__       (				lowerCamelCase     :			int = 678910   ):
       _A     :	List[str]      =					90
       _A     :	List[Any]      =					0

       _A     :	List[str]      =					math.log(1.23  ,10   )
       _A     :	Any      =					math.log(1.24  ,10   )
       _A     :	Union[str, Any]      =					0

       while position < number:
              _A     :	Dict      =					log_difference(lowerCamelCase   )

              if difference >= upper_limit:
                     power_iterator += 93

              elif difference < lower_limit:
                     power_iterator += 196

              else:
                     _A     :	str      =					power_iterator
                     power_iterator += 196
                     position += 1

       return previous_power


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(f"""{solution() = }""")






