


from __future__ import annotations

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

@total_ordering
class 		__a      (				_UpperCAmelCase			):
		def __lt__(			self			,    _SCREAMING_SNAKE_CASE						) ->       Dict:




									"""simple docstring"""





									return self[-1] < other[-1]






		def __eq__(			self			,    _SCREAMING_SNAKE_CASE						) ->       Tuple:




									"""simple docstring"""





									return self[-1] == other[-1]



def        lowerCAmelCase__ (			a__:		str       )  ->		list:


							'''simple docstring'''





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


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


def 							_lowercase							(     )		->		Optional[int]:
					'''simple docstring'''


					SCREAMING_SNAKE_CASE__													= []
					SCREAMING_SNAKE_CASE__													= 1

					while len(UpperCamelCase_		) < 1e6:
										constant.append(str(UpperCamelCase_		)		)
										i += 1

					SCREAMING_SNAKE_CASE__													= ''.join(UpperCamelCase_		)

					return (
					    int(constant[0]		)
					    * int(constant[9]		)
					    * int(constant[99]		)
					    * int(constant[999]		)
					    * int(constant[9999]		)
					    * int(constant[99999]		)
					    * int(constant[999999]		)
					)


if __name__ == "__main__":
				print(solution())





