



import math
import os
import sys






def  lowerCamelCase_	(      lowerCAmelCase__	:	str				)       ->							str:

							'''simple docstring'''






							A      						=    ''
							try:
														with open(lowerCAmelCase__			,	'rb'				) as binary_file:
																					A      						=    binary_file.read()
														for dat in data:
																					A      						=    F'''{dat:08b}'''
																					result += curr_byte
														return result
							except OSError:
														print('File not accessible'				)
														sys.exit()






def  lowerCamelCase_	(      lowerCAmelCase__	:	dict[str, str]			,	lowerCAmelCase__	:	str			,	lowerCAmelCase__	:	int			,	lowerCAmelCase__	:	str				)       ->							None:

							'''simple docstring'''






							lexicon.pop(lowerCAmelCase__				)
							A      						=    last_match_id

							if math.loga(lowerCAmelCase__				).is_integer():
														for curr_key in lexicon:
																					A      						=    '0' + lexicon[curr_key]

							A      						=    bin(lowerCAmelCase__				)[2:]






def  lowerCamelCase_	(      lowerCAmelCase__	:	str				)       ->							str:

							'''simple docstring'''






							A      						=    {'0': '0', '1': '1'}
							A						,   A      						=    '', ''
							A      						=    len(lowerCAmelCase__				)

							for i in range(len(lowerCAmelCase__				)				):
														curr_string += data_bits[i]
														if curr_string not in lexicon:
																					continue

														A      						=    lexicon[curr_string]
														result += last_match_id
														add_key_to_lexicon(lowerCAmelCase__			,	lowerCAmelCase__			,	lowerCAmelCase__			,	lowerCAmelCase__				)
														index += 1
														A      						=    ''

							while curr_string != "" and curr_string not in lexicon:
														curr_string += "0"

							if curr_string != "":
														A      						=    lexicon[curr_string]
														result += last_match_id

							return result






def  lowerCamelCase_	(      lowerCAmelCase__	:	str			,	lowerCAmelCase__	:	str				)       ->							str:

							'''simple docstring'''






							A      						=    os.path.getsize(lowerCAmelCase__				)
							A      						=    bin(lowerCAmelCase__				)[2:]
							A      						=    len(lowerCAmelCase__				)

							return "0" * (length_length - 1) + file_length_binary + compressed






def  lowerCamelCase_	(      lowerCAmelCase__	:	str			,	lowerCAmelCase__	:	str				)       ->							None:

							'''simple docstring'''






							A      						=    8
							try:
														with open(lowerCAmelCase__			,	'wb'				) as opened_file:
																					A      						=    [
																					    to_write[i : i + byte_length]
																					    for i in range(0			,	len(lowerCAmelCase__				)			,	lowerCAmelCase__				)
																					]

																					if len(result_byte_array[-1]				) % byte_length == 0:
																												result_byte_array.append('10000000'				)
																					else:
																												result_byte_array[-1] += "1" + "0" * (
																												    byte_length - len(result_byte_array[-1]				) - 1
																												)

																					for elem in result_byte_array:
																												opened_file.write(int(lowerCAmelCase__			,	2				).to_bytes(1			,	byteorder='big'				)				)
							except OSError:
														print('File not accessible'				)
														sys.exit()






def  lowerCamelCase_	(      lowerCAmelCase__	:	str			,	lowerCAmelCase__	:	str				)       ->							None:

							'''simple docstring'''






							A      						=    read_file_binary(lowerCAmelCase__				)
							A      						=    compress_data(lowerCAmelCase__				)
							A      						=    add_file_length(lowerCAmelCase__			,	lowerCAmelCase__				)
							write_file_binary(lowerCAmelCase__			,	lowerCAmelCase__				)


if __name__ == "__main__":
				compress(sys.argv[1], sys.argv[2])




"""simple docstring"""




from __future__ import annotations

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






@total_ordering
class       UpperCAmelCase_    (							_UpperCamelCase		):



      def __lt__(	self	:      int	,      A	:      Dict		):
           return self[-1] < other[-1]



      def __eq__(	self	:      Union[str, Any]	,      A	:      Union[str, Any]		):
           return self[-1] == other[-1]







def 		__snake_case		( SCREAMING_SNAKE_CASE__      :		list							)    ->  list:





     '''simple docstring'''

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

    # use a heap-based merge to merge stack efficiently
     _UpperCAmelCase     :      Optional[Any]														=       merge(*(reversed(SCREAMING_SNAKE_CASE__							) for stack in stacks)							)
     return collection


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