


'''simple docstring'''



__A						='ABCDEFGHIJKLMNOPQRSTUVWXYZ'







def      _UpperCamelCase   (		):
			UpperCAmelCase__	:       str   =  input("""Enter message: """       )
			UpperCAmelCase__	:       Dict   =  input("""Enter key [alphanumeric]: """       )
			UpperCAmelCase__	:       Dict   =  input("""Encrypt/Decrypt [e/d]: """       )

			if mode.lower().startswith("""e"""       ):
						UpperCAmelCase__	:       List[Any]   =  'encrypt'
						UpperCAmelCase__	:       List[Any]   =  encrypt_message(__UpperCAmelCase			,   __UpperCAmelCase       )
			elif mode.lower().startswith("""d"""       ):
						UpperCAmelCase__	:       List[Any]   =  'decrypt'
						UpperCAmelCase__	:       Optional[int]   =  decrypt_message(__UpperCAmelCase			,   __UpperCAmelCase       )

			print(f'''\n{mode.title()}ed message:'''       )
			print(__UpperCAmelCase       )







def      _UpperCamelCase   (		UpperCamelCase__			,   UpperCamelCase__       ):
			return translate_message(__UpperCAmelCase			,   __UpperCAmelCase			,   """encrypt"""       )







def      _UpperCamelCase   (		UpperCamelCase__			,   UpperCamelCase__       ):
			return translate_message(__UpperCAmelCase			,   __UpperCAmelCase			,   """decrypt"""       )







def      _UpperCamelCase   (		UpperCamelCase__			,   UpperCamelCase__			,   UpperCamelCase__       ):
			UpperCAmelCase__	:       int   =  []
			UpperCAmelCase__	:       Optional[Any]   =  0
			UpperCAmelCase__	:       int   =  key.upper()

			for symbol in message:
						UpperCAmelCase__	:       str   =  LETTERS.find(symbol.upper()       )
						if num != -1:
									if mode == "encrypt":
												num += LETTERS.find(key[key_index]       )
									elif mode == "decrypt":
												num -= LETTERS.find(key[key_index]       )

									num %= len(__UpperCAmelCase       )

									if symbol.isupper():
												translated.append(LETTERS[num]       )
									elif symbol.islower():
												translated.append(LETTERS[num].lower()       )

									key_index += 1
									if key_index == len(__UpperCAmelCase       ):
												UpperCAmelCase__	:       Any   =  0
						else:
									translated.append(__UpperCAmelCase       )
			return "".join(__UpperCAmelCase       )


if __name__ == "__main__":
		main()




'''simple docstring'''

from __future__ import annotations

from bisect import bisect_left
from functools import total_ordering
from heapq import merge






@total_ordering
class 						a_		(     snake_case    ):


							def __lt__(				self   :						List[Any]      ,						a_   :						Optional[int]			)			->					List[str]:
										return self[-1] < other[-1]




							def __eq__(				self   :						int      ,						a_   :						Union[str, Any]			)			->					List[str]:
										return self[-1] == other[-1]







def a_     (    __UpperCAmelCase					)				->					list:





			"""simple docstring"""







			snake_case:    list[Stack]      							=[]
			# sort into stacks
			for element in collection:
						snake_case:    int      							=Stack([element]					)
						snake_case:    Union[str, Any]      							=bisect_left(__UpperCAmelCase				,							__UpperCAmelCase					)
						if i != len(__UpperCAmelCase					):
									stacks[i].append(__UpperCAmelCase					)
						else:
									stacks.append(__UpperCAmelCase					)

    # use a heap-based merge to merge stack efficiently
			snake_case:    int      							=merge(*(reversed(__UpperCAmelCase					) for stack in stacks)					)
			return collection


if __name__ == "__main__":
	a							   =				input('Enter numbers separated by a comma:\n').strip()
	a							   =				[int(item) for item in user_input.split(',')]
	print(patience_sort(unsorted))




