


"""simple docstring"""






def 							A_					(   snake_case__					,				snake_case__		)				->     str:
			if not isinstance(snake_case__					,				snake_case__		):
						raise TypeError('''plaintext must be a string'''		)
			if not isinstance(snake_case__					,				snake_case__		):
						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
			_UpperCamelCase				:int				    =  plaintext.lower()
			_UpperCamelCase				:Optional[Any]				    =  key.lower()
			_UpperCamelCase				:str				    =  0
			_UpperCamelCase				:List[str]				    =  0
			_UpperCamelCase				:Dict				    =  ''''''
			while plaintext_iterator < len(snake_case__		):
						if (
						    ord(plaintext[plaintext_iterator]		) < 97
						    or ord(plaintext[plaintext_iterator]		) > 1_22
						):
									ciphertext += plaintext[plaintext_iterator]
									plaintext_iterator += 1
						elif ord(key[key_iterator]		) < 97 or ord(key[key_iterator]		) > 1_22:
									key_iterator += 1
						else:
									ciphertext += chr(
									    (
									        (ord(plaintext[plaintext_iterator]		) - 97 + ord(key[key_iterator]		))
									        - 97
									    )
									    % 26
									    + 97		)
									key_iterator += 1
									plaintext_iterator += 1
			return ciphertext





def 							A_					(   snake_case__					,				snake_case__		)				->     str:
			if not isinstance(snake_case__					,				snake_case__		):
						raise TypeError('''ciphertext must be a string'''		)
			if not isinstance(snake_case__					,				snake_case__		):
						raise TypeError('''key must be a string'''		)

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

			_UpperCamelCase				:Dict				    =  key.lower()
			_UpperCamelCase				:Tuple				    =  0
			_UpperCamelCase				:Optional[Any]				    =  0
			_UpperCamelCase				:List[str]				    =  ''''''
			while ciphertext_iterator < len(snake_case__		):
						if (
						    ord(ciphertext[ciphertext_iterator]		) < 97
						    or ord(ciphertext[ciphertext_iterator]		) > 1_22
						):
									plaintext += ciphertext[ciphertext_iterator]
						else:
									plaintext += chr(
									    (ord(ciphertext[ciphertext_iterator]		) - ord(key[key_iterator]		)) % 26
									    + 97		)
									key += chr(
									    (ord(ciphertext[ciphertext_iterator]		) - ord(key[key_iterator]		)) % 26
									    + 97		)
									key_iterator += 1
						ciphertext_iterator += 1
			return plaintext


if __name__ == "__main__":
					import doctest

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





"""simple docstring"""






from __future__ import annotations

from enum import Enum






class     A(     lowerCamelCase__		):

		"""simple docstring"""





		A         =       24
		A         =       21
		A         =       18
		A         =       15
		A         =       12
		A         =       9
		A         =       6
		A         =       3
		A         =       2
		A         =       1
		A         =       -1
		A         =       -2
		A         =       -3
		A         =       -6
		A         =       -9
		A         =       -12
		A         =       -15
		A         =       -18
		A         =       -21
		A         =       -24






class     A(     lowerCamelCase__		):

		"""simple docstring"""





		A         =       8
		A         =       7
		A         =       6
		A         =       5
		A         =       4
		A         =       3
		A         =       2
		A         =       1





def 							A_					(   snake_case__					,				snake_case__					,				snake_case__					,				)				->     float:
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Tuple				    =  SIUnit[known_prefix.lower()]
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Optional[int]				    =  SIUnit[unknown_prefix.lower()]
			_UpperCamelCase				:float				    =  known_amount * (
			    10 ** (known_prefix.value - unknown_prefix.value)
			)
			return unknown_amount





def 							A_					(   snake_case__					,				snake_case__					,				snake_case__					,				)				->     float:
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Any				    =  BinaryUnit[known_prefix.lower()]
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Dict				    =  BinaryUnit[unknown_prefix.lower()]
			_UpperCamelCase				:float				    =  known_amount * (
			    2 ** ((known_prefix.value - unknown_prefix.value) * 10)
			)
			return unknown_amount


if __name__ == "__main__":
					import doctest

					doctest.testmod()

