





def 			SCREAMING_SNAKE_CASE__     (					_lowercase    :   str      ,						_lowercase    :   str )      ->       str:




		'''simple docstring'''
		if not isinstance(_lowercase      ,						_lowercase ):
				raise TypeError('plaintext must be a string' )
		if not isinstance(_lowercase      ,						_lowercase ):
				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
		lowercase__				:			Optional[Any]            =		plaintext.lower()
		lowercase__				:			List[str]            =		key.lower()
		lowercase__				:			Dict            =		0
		lowercase__				:			int            =		0
		lowercase__				:			List[str]            =		''
		while plaintext_iterator < len(_lowercase ):
				if (
				    ord(plaintext[plaintext_iterator] ) < 97
				    or ord(plaintext[plaintext_iterator] ) > 122
				):
						ciphertext += plaintext[plaintext_iterator]
						plaintext_iterator += 1
				elif ord(key[key_iterator] ) < 97 or ord(key[key_iterator] ) > 122:
						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 			SCREAMING_SNAKE_CASE__     (					_lowercase    :   str      ,						_lowercase    :   str )      ->       str:




		'''simple docstring'''
		if not isinstance(_lowercase      ,						_lowercase ):
				raise TypeError('ciphertext must be a string' )
		if not isinstance(_lowercase      ,						_lowercase ):
				raise TypeError('key must be a string' )

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

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









def 			SCREAMING_SNAKE_CASE__     (					_lowercase    :   list )      ->       list:




		'''simple docstring'''
		lowercase__				:			Any            =		len(_lowercase )
		for cycle_start in range(0      ,						array_len - 1 ):
				lowercase__				:			List[str]            =		array[cycle_start]

				lowercase__				:			str            =		cycle_start
				for i in range(cycle_start + 1      ,						_lowercase ):
						if array[i] < item:
								pos += 1

				if pos == cycle_start:
						continue

				while item == array[pos]:
						pos += 1

				lowercase__      ,							lowercase__				:			Optional[Any]            =		item, array[pos]
				while pos != cycle_start:
						lowercase__				:			str            =		cycle_start
						for i in range(cycle_start + 1      ,						_lowercase ):
								if array[i] < item:
										pos += 1

						while item == array[pos]:
								pos += 1

						lowercase__      ,							lowercase__				:			Tuple            =		item, array[pos]

		return array


if __name__ == "__main__":
			assert cycle_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
			assert cycle_sort([0, 1, -1_0, 1_5, 2, -2]) == [-1_0, -2, 0, 1, 2, 1_5]


