






'''simple docstring'''





from __future__ import annotations
def __UpperCAmelCase					( A :       int						)  ->					list[int]:
			UpperCAmelCase_	:    List[Any]	  =    2
			UpperCAmelCase_	:    List[str]	  =    []
			while i * i <= n:
						if n % i:
									i += 1
						else:
									n //= i
									factors.append(__snake_case						)
			if n > 1:
						factors.append(__snake_case						)
			return factors


if __name__ == "__main__":
						import doctest

						doctest.testmod()




"""simple docstring"""




from __future__ import annotations

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

@total_ordering
class 		a__						(      a_						):
   def __lt__(			self	,    _a				):
          return self[-1] < other[-1]

   def __eq__(			self	,    _a				):
          return self[-1] == other[-1]


def   __magic_name__	(      __snake_case				:       list  ) ->				list:
       lowercase    :				list[Stack]       		=							[]
       # sort into stacks
       for element in collection:
              lowercase    :				Union[str, Any]       		=							Stack([element]  )
              lowercase    :				Dict       		=							bisect_left(__snake_case     , __snake_case  )
              if i != len(__snake_case  ):
                     stacks[i].append(__snake_case  )
              else:
                     stacks.append(__snake_case  )

    # use a heap-based merge to merge stack efficiently
       lowercase    :				Dict       		=							merge(*(reversed(__snake_case  ) for stack in stacks)  )
       return collection


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


