


"""simple docstring"""






UpperCamelCase__				:Dict			   =	"""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""





def 				A_       ( )					->  None:
			_UpperCamelCase					:str					     =	input('''Enter message: '''		)
			_UpperCamelCase					:List[str]					     =	input('''Enter key [alphanumeric]: '''		)
			_UpperCamelCase					:Union[str, Any]					     =	input('''Encrypt/Decrypt [e/d]: '''		)

			if mode.lower().startswith('''e'''		):
						_UpperCamelCase					:Any					     =	'''encrypt'''
						_UpperCamelCase					:List[str]					     =	encrypt_message(snake_case__       ,					snake_case__		)
			elif mode.lower().startswith('''d'''		):
						_UpperCamelCase					:Any					     =	'''decrypt'''
						_UpperCamelCase					:Dict					     =	decrypt_message(snake_case__       ,					snake_case__		)

			print(f"\n{mode.title()}ed message:"		)
			print(snake_case__		)





def 				A_       ( snake_case__       ,					snake_case__		)					->  str:
			return translate_message(snake_case__       ,					snake_case__       ,					'''encrypt'''		)





def 				A_       ( snake_case__       ,					snake_case__		)					->  str:
			return translate_message(snake_case__       ,					snake_case__       ,					'''decrypt'''		)





def 				A_       ( snake_case__       ,					snake_case__       ,					snake_case__		)					->  str:
			_UpperCamelCase					:Any					     =	[]
			_UpperCamelCase					:List[str]					     =	0
			_UpperCamelCase					:Dict					     =	key.upper()

			for symbol in message:
						_UpperCamelCase					:int					     =	LETTERS.find(symbol.upper()		)
						if num != -1:
									if mode == "encrypt":
												num += LETTERS.find(key[key_index]		)
									elif mode == "decrypt":
												num -= LETTERS.find(key[key_index]		)

									num %= len(snake_case__		)

									if symbol.isupper():
												translated.append(LETTERS[num]		)
									elif symbol.islower():
												translated.append(LETTERS[num].lower()		)

									key_index += 1
									if key_index == len(snake_case__		):
												_UpperCamelCase					:Optional[Any]					     =	0
						else:
									translated.append(snake_case__		)
			return "".join(snake_case__		)


if __name__ == "__main__":
					main()





"""simple docstring"""






def 				A_       ( snake_case__       ,					snake_case__ = " "		)					->  list:
			_UpperCamelCase					:List[str]					     =	[]

			_UpperCamelCase					:int					     =	0
			for index, char in enumerate(snake_case__		):
						if char == separator:
									split_words.append(string[last_index:index]		)
									_UpperCamelCase					:Dict					     =	index + 1
						elif index + 1 == len(snake_case__		):
									split_words.append(string[last_index : index + 1]		)
			return split_words


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

					testmod()

