



def  _lowerCAmelCase     (_lowerCAmelCase ,						_lowerCAmelCase):
					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
					UpperCamelCase_			= plaintext.lower()
					UpperCamelCase_			= key.lower()
					UpperCamelCase_			= 0
					UpperCamelCase_			= 0
					UpperCamelCase_			= ""
					while plaintext_iterator < len(_lowerCAmelCase):
										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  _lowerCAmelCase     (_lowerCAmelCase ,						_lowerCAmelCase):
					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")

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








class        _SCREAMING_SNAKE_CASE			:





	def __init__(						self							:   Tuple      ):
		UpperCamelCase	:List[str]		=      [0]
		UpperCamelCase	:Optional[int]		=      0





	def 		_A					(						self							:   Dict					,    __lowerCamelCase							:   int      ):
		UpperCamelCase	:List[str]		=      self.__heap[i]
		while i // 2 > 0:
			if self.__heap[i] > self.__heap[i // 2]:
				UpperCamelCase	:Any		=      self.__heap[i // 2]
				UpperCamelCase	:Optional[Any]		=      temporary
			i //= 2





	def 		_A					(						self							:   Optional[int]					,    __lowerCamelCase							:   int      ):
		self.__heap.append(__lowerCamelCase      )
		self.__size += 1
		self.__swap_up(self.__size      )





	def 		_A					(						self							:   Optional[Any]					,    __lowerCamelCase							:   int      ):
		while self.__size >= 2 * i:
			if 2 * i + 1 > self.__size:
				UpperCamelCase	:List[Any]		=      2 * i
			else:
				if self.__heap[2 * i] > self.__heap[2 * i + 1]:
					UpperCamelCase	:Union[str, Any]		=      2 * i
				else:
					UpperCamelCase	:Dict		=      2 * i + 1
			UpperCamelCase	:Optional[Any]		=      self.__heap[i]
			if self.__heap[i] < self.__heap[bigger_child]:
				UpperCamelCase	:List[str]		=      self.__heap[bigger_child]
				UpperCamelCase	:List[str]		=      temporary
			UpperCamelCase	:Optional[int]		=      bigger_child





	def 		_A					(						self							:   Optional[Any]      ):
		UpperCamelCase	:str		=      self.__heap[1]
		UpperCamelCase	:Tuple		=      self.__heap[self.__size]
		self.__size -= 1
		self.__heap.pop()
		self.__swap_down(1      )
		return max_value





	@property
	def 		_A					(						self							:   int      ):
		return self.__heap[1:]





	def __len__(						self							:   str      ):
		return self.__size


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	# create an instance of BinaryHeap
	UpperCAmelCase_					:		Optional[int]           = BinaryHeap()
	binary_heap.insert(6)
	binary_heap.insert(10)
	binary_heap.insert(15)
	binary_heap.insert(12)
	# pop root(max-values because it is max heap)
	print(binary_heap.pop())  # 15
	print(binary_heap.pop())  # 12
	# get the list and size after operations
	print(binary_heap.get_list)
	print(len(binary_heap))
