

"""simple docstring"""






def 		A_	(   __UpperCamelCase     :				list       ,	__UpperCamelCase     :				int       ,	__UpperCamelCase     :				int				):
		if right <= left:
				return
		lowercase										=							lowercase										=							left
		lowercase										=							right
		lowercase										=							sorting[left]
		while i <= b:
				if sorting[i] < pivot:
						lowercase					,  lowercase										=							sorting[i], sorting[a]
						a += 1
						i += 1
				elif sorting[i] > pivot:
						lowercase					,  lowercase										=							sorting[i], sorting[b]
						b -= 1
				else:
						i += 1
		quick_sort_apartition(__UpperCamelCase       ,	__UpperCamelCase       ,	a - 1				)
		quick_sort_apartition(__UpperCamelCase       ,	b + 1       ,	__UpperCamelCase				)
def 		A_	(   __UpperCamelCase     :				list       ,	__UpperCamelCase     :				int       ,	__UpperCamelCase     :				int				):
		if left < right:
				lowercase										=							lomuto_partition(__UpperCamelCase       ,	__UpperCamelCase       ,	__UpperCamelCase				)
				quick_sort_lomuto_partition(__UpperCamelCase       ,	__UpperCamelCase       ,	pivot_index - 1				)
				quick_sort_lomuto_partition(__UpperCamelCase       ,	pivot_index + 1       ,	__UpperCamelCase				)
def 		A_	(   __UpperCamelCase     :				list       ,	__UpperCamelCase     :				int       ,	__UpperCamelCase     :				int				):
		lowercase										=							sorting[right]
		lowercase										=							left
		for i in range(__UpperCamelCase       ,	__UpperCamelCase				):
				if sorting[i] < pivot:
						lowercase					,  lowercase										=							sorting[i], sorting[store_index]
						store_index += 1
		lowercase					,  lowercase										=							sorting[store_index], sorting[right]
		return store_index
def 		A_	(   __UpperCamelCase     :				list				):
		if len(__UpperCamelCase				) <= 1:
				return sorting
		return (
		    three_way_radix_quicksort([i for i in sorting if i < sorting[0]]				)
		    + [i for i in sorting if i == sorting[0]]
		    + three_way_radix_quicksort([i for i in sorting if i > sorting[0]]				)
		)


if __name__ == "__main__":
							import doctest

							doctest.testmod(verbose=True)

							__lowerCAmelCase				      =   input('''Enter numbers separated by a comma:\n''').strip()
							__lowerCAmelCase				      =   [int(item) for item in user_input.split(''',''')]
							quick_sort_apartition(unsorted, 0, len(unsorted) - 1)
							print(unsorted)


"""simple docstring"""






def 		A_	(   __UpperCamelCase     :				str       ,	__UpperCamelCase     :				str				):
		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
		lowercase										=							plaintext.lower()
		lowercase										=							key.lower()
		lowercase										=							0
		lowercase										=							0
		lowercase										=							''''''
		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 		A_	(   __UpperCamelCase     :				str       ,	__UpperCamelCase     :				str				):
		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'''				)

		lowercase										=							key.lower()
		lowercase										=							0
		lowercase										=							0
		lowercase										=							''''''
		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()
							__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''')