




def      UpperCAmelCase  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     str:







				'''simple docstring'''


				if not isinstance(UpperCamelCase__						,			UpperCamelCase__   ):
								raise TypeError("""plaintext must be a string"""   )
				if not isinstance(UpperCamelCase__						,			UpperCamelCase__   ):
								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
				__lowerCAmelCase					=  plaintext.lower()
				__lowerCAmelCase					=  key.lower()
				__lowerCAmelCase					=  0
				__lowerCAmelCase					=  0
				__lowerCAmelCase					=  """"""
				while plaintext_iterator < len(UpperCamelCase__   ):
								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      UpperCAmelCase  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     str:







				'''simple docstring'''


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

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

				__lowerCAmelCase					=  key.lower()
				__lowerCAmelCase					=  0
				__lowerCAmelCase					=  0
				__lowerCAmelCase					=  """"""
				while ciphertext_iterator < len(UpperCamelCase__   ):
								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()
	__A						:		Tuple          =						int(input("Type 1 to encrypt or 2 to decrypt:"))
	if operation == 1:
		__A						:		Tuple          =						input("Typeplaintext to be encrypted:\n")
		__A						:		Tuple          =						input("Type the key:\n")
		print(encrypt(plaintext, key))
	elif operation == 2:
		__A						:		List[str]          =						input("Type the ciphertext to be decrypted:\n")
		__A						:		Optional[Any]          =						input("Type the key:\n")
		print(decrypt(ciphertext, key))
	decrypt("jsqqs avvwo", "coffee")












'''simple docstring'''






import math
from collections.abc import Generator





def    lowercase_   (		lowercase__    ) ->Generator[int, None, None]:
						_snake_case: Generator	       =		(i for i in range(1					,	(max_n + 1)    ))
						for i in (n for n in numbers if n > 1):
												for j in range(2					,	lowercase__    ):
																		if (i % j) == 0:
																								break
												else:
																		yield i





def    lowercase_   (		lowercase__    ) ->Generator[int, None, None]:
						_snake_case: Generator	       =		(i for i in range(1					,	(max_n + 1)    ))
						for i in (n for n in numbers if n > 1):
												# only need to check for factors up to sqrt(i)
												_snake_case: int	       =		int(math.sqrt(lowercase__    )    ) + 1
												for j in range(2					,	lowercase__    ):
																		if (i % j) == 0:
																								break
												else:
																		yield i





def    lowercase_   (		lowercase__    ) ->Generator[int, None, None]:
						_snake_case: Generator	       =		(i for i in range(1					,	(max_n + 1)					,	2    ))
						# It's useless to test even numbers as they will not be prime
						if max_n > 2:
												yield 2  # Because 2 will not be tested, it's necessary to yield it now
						for i in (n for n in numbers if n > 1):
												_snake_case: List[str]	       =		int(math.sqrt(lowercase__    )    ) + 1
												for j in range(3					,	lowercase__					,	2    ):
																		# As we removed the even numbers, we don't need them now
																		if (i % j) == 0:
																								break
												else:
																		yield i





def    lowercase_   (		) ->Optional[int]:
						from timeit import timeit

						_snake_case: Dict	       =		'from __main__ import slow_primes, primes, fast_primes'
						print(timeit('slow_primes(1_000_000_000_000)'					,	setup=lowercase__					,	number=100_0000    )    )
						print(timeit('primes(1_000_000_000_000)'					,	setup=lowercase__					,	number=100_0000    )    )
						print(timeit('fast_primes(1_000_000_000_000)'					,	setup=lowercase__					,	number=100_0000    )    )


if __name__ == "__main__":
		A :			List[str]							   =      int(input('Calculate primes up to:\n>> ').strip())
		for ret in primes(number):
				print(ret)
		benchmark()





