'''simple docstring'''




from __future__ import annotations

from random import randrange



def 						__snake_case (       lowerCAmelCase       :     list			):
 if len(lowerCAmelCase			) < 2:
  return collection
 __UpperCAmelCase         =					randrange(len(lowerCAmelCase			)			)  # Use random element as pivot
 __UpperCAmelCase         =					collection[pivot_index]
 __UpperCAmelCase         =					[]  # All elements greater than pivot
 __UpperCAmelCase         =					[]  # All elements less than or equal to pivot

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

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

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


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




'''simple docstring'''




def 						__snake_case (       lowerCAmelCase       :     list			):

 for insert_index, insert_value in enumerate(collection[1:]			):
  __UpperCAmelCase         =					insert_index
  while insert_index >= 0 and insert_value < collection[insert_index]:
   __UpperCAmelCase         =					collection[insert_index]
   insert_index -= 1
  if insert_index != temp_index:
   __UpperCAmelCase         =					insert_value
 return collection


if __name__ == "__main__":
     from doctest import testmod

     testmod()

     _UpperCamelCase				:		List[Any]       			=		input('Enter numbers separated by a comma:\n').strip()
     _UpperCamelCase				:		List[Any]       			=		[int(item) for item in user_input.split(',')]
     print(f"{insertion_sort(unsorted) = }")



