




from __future__ import annotations

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





@total_ordering
class 	lowerCamelCase_							(				_SCREAMING_SNAKE_CASE ):


	'''simple docstring'''







	def __lt__(							self  :		List[Any]    ,    _lowerCAmelCase  :		List[Any]						):
							return self[-1] < other[-1]




	def __eq__(							self  :		Dict    ,    _lowerCAmelCase  :		int						):
							return self[-1] == other[-1]


def  UpperCAmelCase_							(				__UpperCAmelCase						:     list							) ->			list:
						SCREAMING_SNAKE_CASE_     						=      []
						# sort into stacks
						for element in collection:
												SCREAMING_SNAKE_CASE_     						=      Stack([element]							)
												SCREAMING_SNAKE_CASE_     						=      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
						SCREAMING_SNAKE_CASE_     						=      merge(*(reversed(__UpperCAmelCase							) for stack in stacks)							)
						return collection


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





from abc import ABC, abstractmethod
from argparse import ArgumentParser





class 	lowerCamelCase_							(				_SCREAMING_SNAKE_CASE ):


 '''simple docstring'''







 @staticmethod
 @abstractmethod
 def 				lowerCAmelCase_  (							_lowerCAmelCase  :		ArgumentParser						):
       raise NotImplementedError()




 @abstractmethod
 def 				lowerCAmelCase_  (							self  :		Dict						):
       raise NotImplementedError()