



def 					__lowerCAmelCase		(  __lowerCamelCase	:    int	)  ->						Dict:
					__lowerCAmelCase	   =""""""
					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 					__lowerCAmelCase		(  __lowerCamelCase	:    Optional[Any]	)  ->						Optional[int]:
					__lowerCAmelCase	   =[chr(i + 65	) for i in range(26	)]
					# Remove duplicate characters from key
					__lowerCAmelCase	   =remove_duplicates(key.upper()	)
					__lowerCAmelCase	   =len(_UpperCAmelCase	)
					# First fill cipher with key characters
					__lowerCAmelCase	   ={alphabet[i]: char for i, char in enumerate(_UpperCAmelCase	)}
					# Then map remaining characters in alphabet to
					# the alphabet from the beginning
					for i in range(len(_UpperCAmelCase	)				,   26	):
										__lowerCAmelCase	   =alphabet[i - offset]
										# Ensure we are not mapping letters to letters previously mapped
										while char in key:
															offset -= 1
															__lowerCAmelCase	   =alphabet[i - offset]
										__lowerCAmelCase	   =char
					return cipher_alphabet






def 					__lowerCAmelCase		(  __lowerCamelCase	:    Tuple				,   __lowerCamelCase	:    Any	)  ->						Tuple:
					return "".join(cipher_map.get(_UpperCAmelCase				,   _UpperCAmelCase	) for ch in message.upper()	)






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






def 					__lowerCAmelCase		(  )  ->						Union[str, Any]:
					__lowerCAmelCase	   =input("""Enter message to encode or decode: """	).strip()
					__lowerCAmelCase	   =input("""Enter keyword: """	).strip()
					__lowerCAmelCase	   =input("""Encipher or decipher? E/D:"""	).strip()[0].lower()
					try:
										__lowerCAmelCase	   ={"""e""": encipher, """d""": decipher}[option]
					except KeyError:
										raise KeyError("""invalid input option"""	)
					__lowerCAmelCase	   =create_cipher_map(_UpperCAmelCase	)
					print(func(_UpperCAmelCase				,   _UpperCAmelCase	)	)


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()









def 					__lowerCAmelCase		(  )  ->						Tuple:
					__lowerCAmelCase	   =[]
					__lowerCAmelCase	   =1

					while len(__lowerCamelCase	) < 1E6:
										constant.append(str(__lowerCamelCase	)	)
										i += 1

					__lowerCAmelCase	   ="""""".join(__lowerCamelCase	)

					return (
					    int(constant[0]	)
					    * int(constant[9]	)
					    * int(constant[99]	)
					    * int(constant[999]	)
					    * int(constant[9999]	)
					    * int(constant[99999]	)
					    * int(constant[999999]	)
					)


if __name__ == "__main__":
				print(solution())




