



'''simple docstring'''





import random
import sys

UpperCamelCase__    :     Any			  =   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'



def     UpperCAmelCase     (    )   ->       None:



   """simple docstring"""






   A_  :		Dict						=					input("""Enter message: """		)
   A_  :		Union[str, Any]						=					"""LFWOAYUISVKMNXPBDCRJTQEGHZ"""
   A_  :		List[str]						=					input("""Encrypt/Decrypt [e/d]: """		)

   check_valid_key(a_		)

   if resp.lower().startswith("""e"""		):
      A_  :		List[str]						=					"""encrypt"""
      A_  :		Dict						=					encrypt_message(a_      ,		a_		)
   elif resp.lower().startswith("""d"""		):
      A_  :		int						=					"""decrypt"""
      A_  :		str						=					decrypt_message(a_      ,		a_		)

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



def     UpperCAmelCase     (    a_		)   ->       None:



   """simple docstring"""






   A_  :		Any						=					list(a_		)
   A_  :		Union[str, Any]						=					list(a_		)
   key_list.sort()
   letters_list.sort()

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



def     UpperCAmelCase     (    a_      ,		a_		)   ->       str:



   """simple docstring"""






   return translate_message(a_      ,		a_      ,		"""encrypt"""		)



def     UpperCAmelCase     (    a_      ,		a_		)   ->       str:



   """simple docstring"""






   return translate_message(a_      ,		a_      ,		"""decrypt"""		)



def     UpperCAmelCase     (    a_      ,		a_      ,		a_		)   ->       str:



   """simple docstring"""






   A_  :		int						=					""""""
   A_  :		Optional[int]						=					LETTERS
   A_  :		str						=					key

   if mode == "decrypt":
      A_						,  A_  :		Tuple						=					chars_b, chars_a

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



   """simple docstring"""






   A_  :		int						=					list(a_		)
   random.shuffle(a_		)
   return "".join(a_		)


if __name__ == "__main__":
  main()





'''simple docstring'''





def     UpperCAmelCase     (    a_      ,		a_		)   ->       set:



   """simple docstring"""






   assert isinstance(a_      ,		a_		), F"The input value of [set_a={set_a}] is not a set"
   assert isinstance(a_      ,		a_		), F"The input value of [set_b={set_b}] is not a set"

   return {a + b for a in set_a for b in set_b}


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

  testmod()
