


import itertools
import math
def        UpperCamelCase_(				_A   :int  )->		bool:

			if 1 < number < 4:
						# 2 and 3 are primes
						return True
			elif number < 2 or number % 2 == 0 or number % 3 == 0:
						# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
						return False

			# All primes number are in format of 6k +/- 1
			for i in range(5				,     int(math.sqrt(_A  ) + 1  )				,     6  ):
						if number % i == 0 or number % (i + 2) == 0:
									return False
			return True
def        UpperCamelCase_(				)->		List[str]:
			UpperCamelCase__					=       2
			while True:
						if is_prime(_A  ):
									yield num
						num += 1
def        UpperCamelCase_(				_A   :int = 1_00_01  )->		int:
			return next(itertools.islice(prime_generator()				,     nth - 1				,     _A  )  )


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






def        UpperCamelCase_(				_A   :str  )->		str:
			UpperCamelCase__					=       ""
			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_(				_A   :str  )->		dict[str, str]:
			UpperCamelCase__					=       [chr(i + 65  ) for i in range(26  )]
			# Remove duplicate characters from key
			UpperCamelCase__					=       remove_duplicates(key.upper()  )
			UpperCamelCase__					=       len(_A  )
			# First fill cipher with key characters
			UpperCamelCase__					=       {alphabet[i]: char for i, char in enumerate(_A  )}
			# Then map remaining characters in alphabet to
			# the alphabet from the beginning
			for i in range(len(_A  )				,     26  ):
						UpperCamelCase__					=       alphabet[i - offset]
						# Ensure we are not mapping letters to letters previously mapped
						while char in key:
									offset -= 1
									UpperCamelCase__					=       alphabet[i - offset]
						UpperCamelCase__					=       char
			return cipher_alphabet
def        UpperCamelCase_(				_A   :str				,     _A   :dict[str, str]  )->		str:
			return "".join(cipher_map.get(_A				,     _A  ) for ch in message.upper()  )
def        UpperCamelCase_(				_A   :str				,     _A   :dict[str, str]  )->		str:
			UpperCamelCase__					=       {v: k for k, v in cipher_map.items()}
			return "".join(rev_cipher_map.get(_A				,     _A  ) for ch in message.upper()  )
def        UpperCamelCase_(				)->		None:
			UpperCamelCase__					=       input("Enter message to encode or decode: "  ).strip()
			UpperCamelCase__					=       input("Enter keyword: "  ).strip()
			UpperCamelCase__					=       input("Encipher or decipher? E/D:"  ).strip()[0].lower()
			try:
						UpperCamelCase__					=       {"e": encipher, "d": decipher}[option]
			except KeyError:
						raise KeyError("invalid input option"  )
			UpperCamelCase__					=       create_cipher_map(_A  )
			print(func(_A				,     _A  )  )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()


