


"""simple docstring"""






def       A_   (   _lowerCAmelCase     :					str       ):






     """simple docstring"""

     _a    	=				''''''
     for ch in key:
          if ch == " " or ch not in key_no_dups and ch.isalpha():
               key_no_dups += ch
     return key_no_dups
def       A_   (   _lowerCAmelCase     :					str       ):






     """simple docstring"""

     _a    	=				[chr(i + 65       ) for i in range(26       )]
     # Remove duplicate characters from key
     _a    	=				remove_duplicates(key.upper()       )
     _a    	=				len(_lowerCAmelCase       )
     # First fill cipher with key characters
     _a    	=				{alphabet[i]: char for i, char in enumerate(_lowerCAmelCase       )}
     # Then map remaining characters in alphabet to
     # the alphabet from the beginning
     for i in range(len(_lowerCAmelCase       ),     26       ):
          _a    	=				alphabet[i - offset]
          # Ensure we are not mapping letters to letters previously mapped
          while char in key:
               offset -= 1
               _a    	=				alphabet[i - offset]
          _a    	=				char
     return cipher_alphabet
def       A_   (   _lowerCAmelCase     :					str,     _lowerCAmelCase     :					dict[str, str]       ):






     """simple docstring"""

     return "".join(cipher_map.get(_lowerCAmelCase,     _lowerCAmelCase       ) for ch in message.upper()       )
def       A_   (   _lowerCAmelCase     :					str,     _lowerCAmelCase     :					dict[str, str]       ):






     """simple docstring"""

     _a    	=				{v: k for k, v in cipher_map.items()}
     return "".join(rev_cipher_map.get(_lowerCAmelCase,     _lowerCAmelCase       ) for ch in message.upper()       )
def       A_   (   ):






     """simple docstring"""

     _a    	=				input('''Enter message to encode or decode: '''       ).strip()
     _a    	=				input('''Enter keyword: '''       ).strip()
     _a    	=				input('''Encipher or decipher? E/D:'''       ).strip()[0].lower()
     try:
          _a    	=				{'''e''': encipher, '''d''': decipher}[option]
     except KeyError:
          raise KeyError('''invalid input option'''       )
     _a    	=				create_cipher_map(_lowerCAmelCase       )
     print(func(_lowerCAmelCase,     _lowerCAmelCase       )       )


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()



"""simple docstring"""






from typing import Any
def       A_   (   _lowerCAmelCase     :					list       ):






     """simple docstring"""

     if not input_list:
          return []
     _a    	=				[input_list.count(_lowerCAmelCase       ) for value in input_list]
     _a    	=				max(_lowerCAmelCase       )  # Gets the maximum count in the input list.
     # Gets values of modes
     return sorted({input_list[i] for i, value in enumerate(_lowerCAmelCase       ) if value == y}       )


if __name__ == "__main__":
   import doctest

   doctest.testmod()