

'''simple docstring'''
def       a__    (  _SCREAMING_SNAKE_CASE					:    str     ,							_SCREAMING_SNAKE_CASE					:    str							)			-> str:


	"""simple docstring"""





	if not isinstance(_SCREAMING_SNAKE_CASE     ,							_SCREAMING_SNAKE_CASE							):
		raise TypeError("plaintext must be a string"							)
	if not isinstance(_SCREAMING_SNAKE_CASE     ,							_SCREAMING_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_			:	Optional[int]      =   plaintext.lower()
	UpperCAmelCase_			:	Tuple      =   key.lower()
	UpperCAmelCase_			:	Tuple      =   0
	UpperCAmelCase_			:	Optional[Any]      =   0
	UpperCAmelCase_			:	Union[str, Any]      =   ""
	while plaintext_iterator < len(_SCREAMING_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__    (  _SCREAMING_SNAKE_CASE					:    str     ,							_SCREAMING_SNAKE_CASE					:    str							)			-> str:


	"""simple docstring"""





	if not isinstance(_SCREAMING_SNAKE_CASE     ,							_SCREAMING_SNAKE_CASE							):
		raise TypeError("ciphertext must be a string"							)
	if not isinstance(_SCREAMING_SNAKE_CASE     ,							_SCREAMING_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_			:	Union[str, Any]      =   key.lower()
	UpperCAmelCase_			:	Optional[Any]      =   0
	UpperCAmelCase_			:	Union[str, Any]      =   0
	UpperCAmelCase_			:	List[str]      =   ""
	while ciphertext_iterator < len(_SCREAMING_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()
					_lowerCamelCase	 =			int(input("""Type 1 to encrypt or 2 to decrypt:"""))
					if operation == 1:
										_lowerCamelCase	 =			input("""Typeplaintext to be encrypted:\n""")
										_lowerCamelCase	 =			input("""Type the key:\n""")
										print(encrypt(plaintext, key))
					elif operation == 2:
										_lowerCamelCase	 =			input("""Type the ciphertext to be decrypted:\n""")
										_lowerCamelCase	 =			input("""Type the key:\n""")
										print(decrypt(ciphertext, key))
					decrypt("""jsqqs avvwo""", """coffee""")







'''simple docstring'''
import math
from itertools import permutations


def       a__    (  _SCREAMING_SNAKE_CASE					:    int							)			-> bool:


	"""simple docstring"""





	if 1 < number < 4:
		# 2 and 3 are primes
		return True
	elif number < 2 or number % 2 == 0 or number % 3 == 0:
		# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
		return False

	# All primes number are in format of 6k +/- 1
	for i in range(5     ,							int(math.sqrt(_SCREAMING_SNAKE_CASE							) + 1							)     ,							6							):
		if number % i == 0 or number % (i + 2) == 0:
			return False
	return True


def       a__    (  _SCREAMING_SNAKE_CASE					:    int     ,							_SCREAMING_SNAKE_CASE					:    list							)			-> bool:


	"""simple docstring"""





	UpperCAmelCase_ , UpperCAmelCase_			:	Any      =   0, len(_SCREAMING_SNAKE_CASE							) - 1
	while left <= right:
		UpperCAmelCase_			:	List[str]      =   (left + right) // 2
		if prime_list[middle] == target:
			return True
		elif prime_list[middle] < target:
			UpperCAmelCase_			:	Dict      =   middle + 1
		else:
			UpperCAmelCase_			:	int      =   middle - 1

	return False


def       a__    (  )			-> Tuple:


	"""simple docstring"""





	UpperCAmelCase_			:	Dict      =   [n for n in range(10_01     ,							1_00_00     ,							2							) if is_prime(_SCREAMING_SNAKE_CASE							)]
	UpperCAmelCase_			:	Optional[int]      =   []

	for number in prime_list:
		UpperCAmelCase_			:	Optional[Any]      =   []

		for prime_member in permutations(list(str(_SCREAMING_SNAKE_CASE							)							)							):
			UpperCAmelCase_			:	List[Any]      =   int("".join(_SCREAMING_SNAKE_CASE							)							)

			if prime % 2 == 0:
				continue

			if search(_SCREAMING_SNAKE_CASE     ,							_SCREAMING_SNAKE_CASE							):
				tmp_numbers.append(_SCREAMING_SNAKE_CASE							)

		tmp_numbers.sort()
		if len(_SCREAMING_SNAKE_CASE							) >= 3:
			candidates.append(_SCREAMING_SNAKE_CASE							)

	UpperCAmelCase_			:	Tuple      =   []
	for candidate in candidates:
		UpperCAmelCase_			:	Union[str, Any]      =   len(_SCREAMING_SNAKE_CASE							)
		UpperCAmelCase_			:	Any      =   False

		for i in range(_SCREAMING_SNAKE_CASE							):
			for j in range(i + 1     ,							_SCREAMING_SNAKE_CASE							):
				for k in range(j + 1     ,							_SCREAMING_SNAKE_CASE							):
					if (
					    abs(candidate[i] - candidate[j]							)
					    == abs(candidate[j] - candidate[k]							)
					    and len({candidate[i], candidate[j], candidate[k]}							) == 3
					):
						passed.append(
						    sorted([candidate[i], candidate[j], candidate[k]]							)							)
						UpperCAmelCase_			:	Optional[Any]      =   True

					if found:
						break
				if found:
					break
			if found:
				break

	UpperCAmelCase_			:	Any      =   set()
	for seq in passed:
		answer.add("".join([str(_SCREAMING_SNAKE_CASE							) for i in seq]							)							)

	return max(int(_SCREAMING_SNAKE_CASE							) for x in answer							)


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




