






"""simple docstring"""

def _lowerCAmelCase						(	__lowerCamelCase:str			,    __lowerCamelCase:str ):

						'''simple docstring'''






						if not isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												raise TypeError("plaintext must be a string" )
						if not isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												raise TypeError("key must be a string" )

						if not plaintext:
												raise ValueError("plaintext is empty" )
						if not key:
												raise ValueError("key is empty" )

						key += plaintext
						__magic_name__      =  plaintext.lower()
						__magic_name__      =  key.lower()
						__magic_name__      =  0
						__magic_name__      =  0
						__magic_name__      =  ""
						while plaintext_iterator < len(__lowerCamelCase ):
												if (
												    ord(plaintext[plaintext_iterator] ) < 9_7
												    or ord(plaintext[plaintext_iterator] ) > 1_2_2
												):
																		ciphertext += plaintext[plaintext_iterator]
																		plaintext_iterator += 1
												elif ord(key[key_iterator] ) < 9_7 or ord(key[key_iterator] ) > 1_2_2:
																		key_iterator += 1
												else:
																		ciphertext += chr(
																		    (
																		        (ord(plaintext[plaintext_iterator] ) - 9_7 + ord(key[key_iterator] ))
																		        - 9_7
																		    )
																		    % 2_6
																		    + 9_7 )
																		key_iterator += 1
																		plaintext_iterator += 1
						return ciphertext






def _lowerCAmelCase						(	__lowerCamelCase:str			,    __lowerCamelCase:str ):

						'''simple docstring'''






						if not isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												raise TypeError("ciphertext must be a string" )
						if not isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												raise TypeError("key must be a string" )

						if not ciphertext:
												raise ValueError("ciphertext is empty" )
						if not key:
												raise ValueError("key is empty" )

						__magic_name__      =  key.lower()
						__magic_name__      =  0
						__magic_name__      =  0
						__magic_name__      =  ""
						while ciphertext_iterator < len(__lowerCamelCase ):
												if (
												    ord(ciphertext[ciphertext_iterator] ) < 9_7
												    or ord(ciphertext[ciphertext_iterator] ) > 1_2_2
												):
																		plaintext += ciphertext[ciphertext_iterator]
												else:
																		plaintext += chr(
																		    (ord(ciphertext[ciphertext_iterator] ) - ord(key[key_iterator] )) % 2_6
																		    + 9_7 )
																		key += chr(
																		    (ord(ciphertext[ciphertext_iterator] ) - ord(key[key_iterator] )) % 2_6
																		    + 9_7 )
																		key_iterator += 1
												ciphertext_iterator += 1
						return plaintext


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			lowercase           =							int(input('''Type 1 to encrypt or 2 to decrypt:'''))
			if operation == 1:
						lowercase           =							input('''Typeplaintext to be encrypted:\n''')
						lowercase           =							input('''Type the key:\n''')
						print(encrypt(plaintext, key))
			elif operation == 2:
						lowercase           =							input('''Type the ciphertext to be decrypted:\n''')
						lowercase           =							input('''Type the key:\n''')
						print(decrypt(ciphertext, key))
			decrypt('''jsqqs avvwo''', '''coffee''')











"""simple docstring"""

import math






def _lowerCAmelCase						(	__lowerCamelCase:int ):

						'''simple docstring'''






						if number == 0:
												__magic_name__      =  "Zero"
												return words
						else:
												__magic_name__      =  math.logaa(__lowerCamelCase )
												__magic_name__      =  digits + 1
												__magic_name__      =  {}
												__magic_name__      =  ""
												__magic_name__      =  "One"
												__magic_name__      =  "Two"
												__magic_name__      =  "Three"
												__magic_name__      =  "Four"
												__magic_name__      =  "Five"
												__magic_name__      =  "Six"
												__magic_name__      =  "Seven"
												__magic_name__      =  "Eight"
												__magic_name__      =  "Nine"

												__magic_name__      =  {}
												__magic_name__      =  ""
												__magic_name__      =  "Twenty"
												__magic_name__      =  "Thirty"
												__magic_name__      =  "Forty"
												__magic_name__      =  "Fifty"
												__magic_name__      =  "Sixty"
												__magic_name__      =  "Seventy"
												__magic_name__      =  "Eighty"
												__magic_name__      =  "Ninety"

												__magic_name__      =  {}
												__magic_name__      =  "Ten"
												__magic_name__      =  "Eleven"
												__magic_name__      =  "Twelve"
												__magic_name__      =  "Thirteen"
												__magic_name__      =  "Fourteen"
												__magic_name__      =  "Fifteen"
												__magic_name__      =  "Sixteen"
												__magic_name__      =  "Seventeen"
												__magic_name__      =  "Eighteen"
												__magic_name__      =  "Nineteen"

												__magic_name__      =  {}
												__magic_name__      =  "Hundred,"
												__magic_name__      =  "Thousand,"
												__magic_name__      =  "Lakh,"
												__magic_name__      =  "Crore,"

												__magic_name__      =  number
												__magic_name__      =  ""
												__magic_name__      =  0
												__magic_name__      =  int(__lowerCamelCase )
												while counter < digits:
																		__magic_name__      =  temp_num % 1_0
																		if counter % 2 == 0:
																								__magic_name__      =  ""
																								if counter in placevalue and current != 0:
																														__magic_name__      =  placevalue[counter]
																								if counter == 2:
																														__magic_name__      =  singles[current] + addition + words
																								elif counter == 0:
																														if ((temp_num % 1_0_0) // 1_0) == 1:
																																				__magic_name__      =  teens[current] + addition + words
																																				__magic_name__      =  temp_num // 1_0
																																				counter += 1
																														else:
																																				__magic_name__      =  singles[current] + addition + words

																								else:
																														__magic_name__      =  doubles[current] + addition + words

																		else:
																								if counter == 1:
																														if current == 1:
																																				__magic_name__      =  teens[number % 1_0] + words
																														else:
																																				__magic_name__      =  ""
																																				if counter in placevalue:
																																										__magic_name__      =  placevalue[counter]
																																				__magic_name__      =  doubles[current] + addition + words
																								else:
																														__magic_name__      =  ""
																														if counter in placevalue:
																																				if current == 0 and ((temp_num % 1_0_0) // 1_0) == 0:
																																										__magic_name__      =  ""
																																				else:
																																										__magic_name__      =  placevalue[counter]
																														if ((temp_num % 1_0_0) // 1_0) == 1:
																																				__magic_name__      =  teens[current] + addition + words
																																				__magic_name__      =  temp_num // 1_0
																																				counter += 1
																														else:
																																				__magic_name__      =  singles[current] + addition + words
																		counter += 1
																		__magic_name__      =  temp_num // 1_0
						return words


if __name__ == "__main__":
			import doctest

			doctest.testmod()



