





def 	UpperCamelCase__(       UpperCamelCase__			:       Any  )->str:
       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 	UpperCamelCase__(       UpperCamelCase__			:       int  )->dict[str, str]:
       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 	UpperCamelCase__(       UpperCamelCase__			:       Any ,     UpperCamelCase__			:       List[str]  )->str:
       return "".join(cipher_map.get(_lowerCAmelCase ,     _lowerCAmelCase  ) for ch in message.upper()  )


def 	UpperCamelCase__(       UpperCamelCase__			:       Optional[int] ,     UpperCamelCase__			:       List[Any]  )->str:
       A__											=						{v: k for k, v in cipher_map.items()}
       return "".join(rev_cipher_map.get(_lowerCAmelCase ,     _lowerCAmelCase  ) for ch in message.upper()  )


def 	UpperCamelCase__(       )->None:
       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()












from __future__ import annotations

from functools import lru_cache
from math import ceil

__lowerCamelCase       :     str   =     100

__lowerCamelCase       :     Any   =     set(range(3, NUM_PRIMES, 2))
primes.add(2)
__lowerCamelCase       :     int

for prime in range(3, ceil(NUM_PRIMES**0.5), 2):
    if prime not in primes:
        continue
    primes.difference_update(set(range(prime * prime, NUM_PRIMES, prime)))



@lru_cache(maxsize=100     )
def 		A_				(     _lowerCAmelCase     )						-> set[int]:
 if number_to_partition < 0:
  return set()
 elif number_to_partition == 0:
  return {1}

 UpperCamelCase	:					set[int]       	=   set()
 UpperCamelCase	:					int
 UpperCamelCase	:					int

 for prime in primes:
  if prime > number_to_partition:
   continue
  for sub in partition(number_to_partition - prime     ):
   ret.add(sub * prime     )

 return ret



def 		A_				(     _lowerCAmelCase = 5000     )						-> int | None:
 for number_to_partition in range(1							,   _lowerCAmelCase     ):
  if len(partition(_lowerCAmelCase     )     ) > number_unique_partitions:
   return number_to_partition
 return None


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