



import math






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__ = 0       ,	lowercase__ = 0       ):


     '''simple docstring'''







     a_       		=end or len(lowercase__       )
     for i in range(lowercase__       ,	lowercase__       ):
          a_       		=i
          a_       		=array[i]
          while temp_index != start and temp_index_value < array[temp_index - 1]:
               a_       		=array[temp_index - 1]
               temp_index -= 1
          a_       		=temp_index_value
     return array






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ):  # Max Heap


     '''simple docstring'''







     a_       		=index
     a_       		=2 * index + 1  # Left Node
     a_       		=2 * index + 2  # Right Node

     if left_index < heap_size and array[largest] < array[left_index]:
          a_       		=left_index

     if right_index < heap_size and array[largest] < array[right_index]:
          a_       		=right_index

     if largest != index:
          a_		,						a_       		=array[largest], array[index]
          heapify(lowercase__       ,	lowercase__       ,	lowercase__       )






def  UpperCAmelCase_       (		lowercase__       ):


     '''simple docstring'''







     a_       		=len(lowercase__       )

     for i in range(n // 2       ,	-1       ,	-1       ):
          heapify(lowercase__       ,	lowercase__       ,	lowercase__       )

     for i in range(n - 1       ,	0       ,	-1       ):
          a_		,						a_       		=array[0], array[i]
          heapify(lowercase__       ,	0       ,	lowercase__       )

     return array






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     if (array[first_index] > array[middle_index]) != (
         array[first_index] > array[last_index]
     ):
          return array[first_index]
     elif (array[middle_index] > array[first_index]) != (
         array[middle_index] > array[last_index]
     ):
          return array[middle_index]
     else:
          return array[last_index]






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     a_       		=low
     a_       		=high
     while True:
          while array[i] < pivot:
               i += 1
          j -= 1
          while pivot < array[j]:
               j -= 1
          if i >= j:
               return i
          a_		,						a_       		=array[j], array[i]
          i += 1






def  UpperCAmelCase_       (		lowercase__       ):


     '''simple docstring'''







     if len(lowercase__       ) == 0:
          return array
     a_       		=2 * math.ceil(math.loga(len(lowercase__       )       )       )
     a_       		=1_6
     return intro_sort(lowercase__       ,	0       ,	len(lowercase__       )       ,	lowercase__       ,	lowercase__       )






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     while end - start > size_threshold:
          if max_depth == 0:
               return heap_sort(lowercase__       )
          max_depth -= 1
          a_       		=median_of_a(lowercase__       ,	lowercase__       ,	start + ((end - start) // 2) + 1       ,	end - 1       )
          a_       		=partition(lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       )
          intro_sort(lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       )
          a_       		=p
     return insertion_sort(lowercase__       ,	lowercase__       ,	lowercase__       )


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  lowercase							       =			input('''Enter numbers separated by a comma : ''').strip()
  lowercase							       =			[float(item) for item in user_input.split(''',''')]
  print(sort(unsorted))







'''simple docstring'''


from __future__ import annotations






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     if b == 0:
          return (1, 0)
     ((a_)		,						(a_))       		=extended_euclid(lowercase__       ,	a % b       )
     a_       		=a // b
     return (y, x - k * y)






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     ((a_)		,						(a_))       		=extended_euclid(lowercase__       ,	lowercase__       )
     a_       		=na * na
     a_       		=ra * x * na + ra * y * na
     return (n % m + m) % m






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     ((a_)		,						(a_))       		=extended_euclid(lowercase__       ,	lowercase__       )
     if b < 0:
          a_       		=(b % n + n) % n
     return b






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     a_		,						a_       		=invert_modulo(lowercase__       ,	lowercase__       ), invert_modulo(lowercase__       ,	lowercase__       )
     a_       		=na * na
     a_       		=ra * x * na + ra * y * na
     return (n % m + m) % m


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

  testmod(name='''chinese_remainder_theorem''', verbose=True)
  testmod(name='''chinese_remainder_theorem2''', verbose=True)
  testmod(name='''invert_modulo''', verbose=True)
  testmod(name='''extended_euclid''', verbose=True)


