



"""simple docstring"""






import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
	import ctypes
	import msvcrt  # noqa



	class 			A__   (  ctypes.Structure							):




		'''simple docstring'''





		SCREAMING_SNAKE_CASE          =	[('size', ctypes.c_int), ('visible', ctypes.c_byte)]


def 			_lowercase				(  )						->   List[Any]:
			if os.name == "nt":
						__lowerCAmelCase      :  Dict												=       CursorInfo()
						__lowerCAmelCase      :  Tuple												=       ctypes.windll.kernelaa.GetStdHandle(-11	)
						ctypes.windll.kernelaa.GetConsoleCursorInfo(__snake_case					,ctypes.byref(__snake_case	)	)
						__lowerCAmelCase      :  Any												=       False
						ctypes.windll.kernelaa.SetConsoleCursorInfo(__snake_case					,ctypes.byref(__snake_case	)	)
			elif os.name == "posix":
						sys.stdout.write("\033[?25l"	)
						sys.stdout.flush()


def 			_lowercase				(  )						->   Optional[Any]:
			if os.name == "nt":
						__lowerCAmelCase      :  int												=       CursorInfo()
						__lowerCAmelCase      :  Dict												=       ctypes.windll.kernelaa.GetStdHandle(-11	)
						ctypes.windll.kernelaa.GetConsoleCursorInfo(__snake_case					,ctypes.byref(__snake_case	)	)
						__lowerCAmelCase      :  Union[str, Any]												=       True
						ctypes.windll.kernelaa.SetConsoleCursorInfo(__snake_case					,ctypes.byref(__snake_case	)	)
			elif os.name == "posix":
						sys.stdout.write("\033[?25h"	)
						sys.stdout.flush()





@contextmanager
def 			_lowercase				(  )						->   int:
			try:
						hide_cursor()
						yield
			finally:
						show_cursor()




"""simple docstring"""






from __future__ import annotations


def 			_lowercase				(  __snake_case					,__snake_case					,__snake_case					,__snake_case	)						->   list:
			__lowerCAmelCase      :  Dict												=       []
			__lowerCAmelCase						,	__lowerCAmelCase      :  Any												=       input_list[low:mid], input_list[mid : high + 1]
			while left and right:
						result.append((left if left[0] <= right[0] else right).pop(0	)	)
			__lowerCAmelCase      :  int												=       result + left + right
			return input_list


def 			_lowercase				(  __snake_case	)						->   list:
			if len(__snake_case	) <= 1:
						return input_list
			__lowerCAmelCase      :  int												=       list(__snake_case	)

			# iteration for two-way merging
			__lowerCAmelCase      :  Optional[int]												=       2
			while p <= len(__snake_case	):
						# getting low, high and middle value for merge-sort of single list
						for i in range(0					,len(__snake_case	)					,__snake_case	):
									__lowerCAmelCase      :  Union[str, Any]												=       i
									__lowerCAmelCase      :  Tuple												=       i + p - 1
									__lowerCAmelCase      :  Optional[Any]												=       (low + high + 1) // 2
									__lowerCAmelCase      :  Any												=       merge(__snake_case					,__snake_case					,__snake_case					,__snake_case	)
						# final merge of last two parts
						if p * 2 >= len(__snake_case	):
									__lowerCAmelCase      :  Optional[Any]												=       i
									__lowerCAmelCase      :  Union[str, Any]												=       merge(__snake_case					,0					,__snake_case					,len(__snake_case	) - 1	)
									break
						p *= 2

			return input_list


if __name__ == "__main__":
	__snake_case							:   Union[str, Any]      =    input('Enter numbers separated by a comma:\n').strip()
	if user_input == "":
		__snake_case							:   Optional[int]      =    []
	else:
		__snake_case							:   int      =    [int(item.strip()) for item in user_input.split(',')]
	print(iter_merge_sort(unsorted))