




from __future__ import annotations

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




@total_ordering
class       _A				(		__lowercase     ):






		def __lt__(    self						,		_SCREAMING_SNAKE_CASE			):
								return self[-1] < other[-1]






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




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


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





# flake8: noqa
# Lint as: python3
a													=			[
    "VerificationMode",
    "Version",
    "disable_progress_bar",
    "enable_progress_bar",
    "is_progress_bar_enabled",
    "experimental",
]

from .info_utils import VerificationMode
from .logging import disable_progress_bar, enable_progress_bar, is_progress_bar_enabled
from .version import Version
from .experimental import experimental