





"""simple docstring"""





from __future__ import annotations

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





@total_ordering
class        _lowerCamelCase      (       _lowercase ):


						def __lt__(self   ,							__a		) ->   Optional[int]:
								return self[-1] < other[-1]




						def __eq__(self   ,							__a		) ->   Tuple:
								return self[-1] == other[-1]



def       a__					(					_SCREAMING_SNAKE_CASE    ):




		"""simple docstring"""


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


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













"""simple docstring"""





def       a__					(					_SCREAMING_SNAKE_CASE    ):




		"""simple docstring"""


		return number & 1 == 0


if __name__ == "__main__":
						import doctest

						doctest.testmod()






