



'''simple docstring'''



from __future__ import annotations

from random import randrange


def 							__UpperCAmelCase				(				UpperCamelCase__				:list			)		->						list:
				if len(UpperCamelCase__			) < 2:
								return collection
				snake_case__      :   Dict      =    randrange(len(UpperCamelCase__			)			)  # Use random element as pivot
				snake_case__      :   Optional[Any]      =    collection[pivot_index]
				snake_case__      :   list[int]      =    []  # All elements greater than pivot
				snake_case__      :   list[int]      =    []  # All elements less than or equal to pivot

				for element in collection[:pivot_index]:
								(greater if element > pivot else lesser).append(UpperCamelCase__			)

				for element in collection[pivot_index + 1 :]:
								(greater if element > pivot else lesser).append(UpperCamelCase__			)

				return [*quick_sort(UpperCamelCase__			), pivot, *quick_sort(UpperCamelCase__			)]


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











def      SCREAMING_SNAKE_CASE      (   lowerCAmelCase     ,							lowerCAmelCase     ,							lowerCAmelCase       ):
       _UpperCamelCase														=    index
       _UpperCamelCase														=    2 * index + 1
       _UpperCamelCase														=    2 * index + 2
       if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
              _UpperCamelCase														=    left_index

       if right_index < heap_size and unsorted[right_index] > unsorted[largest]:
              _UpperCamelCase														=    right_index

       if largest != index:
              _UpperCamelCase							,		_UpperCamelCase														=    unsorted[index], unsorted[largest]
              heapify(lowerCAmelCase     ,							lowerCAmelCase     ,							lowerCAmelCase       )


def      SCREAMING_SNAKE_CASE      (   lowerCAmelCase       ):
       _UpperCamelCase														=    len(lowerCAmelCase       )
       for i in range(n // 2 - 1     ,							-1     ,							-1       ):
              heapify(lowerCAmelCase     ,							lowerCAmelCase     ,							lowerCAmelCase       )
       for i in range(n - 1     ,							0     ,							-1       ):
              _UpperCamelCase							,		_UpperCamelCase														=    unsorted[i], unsorted[0]
              heapify(lowerCAmelCase     ,							0     ,							lowerCAmelCase       )
       return unsorted


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






