'''simple docstring'''


import math


def  _lowerCamelCase   (				lowerCamelCase_ :							list     ,					lowerCamelCase_ :							int = 0     ,					lowerCamelCase_ :							int = 0       ):



     """simple docstring"""





     UpperCAmelCase_							:       Any       =				end or len(__a       )
     for i in range(__a     ,					__a       ):
          UpperCAmelCase_							:       Optional[int]       =				i
          UpperCAmelCase_							:       str       =				array[i]
          while temp_index != start and temp_index_value < array[temp_index - 1]:
               UpperCAmelCase_							:       Tuple       =				array[temp_index - 1]
               temp_index -= 1
          UpperCAmelCase_							:       str       =				temp_index_value
     return array


def  _lowerCamelCase   (				lowerCamelCase_ :							list     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):  # Max Heap



     """simple docstring"""





     UpperCAmelCase_							:       Optional[Any]       =				index
     UpperCAmelCase_							:       List[Any]       =				2 * index + 1  # Left Node
     UpperCAmelCase_							:       int       =				2 * index + 2  # Right Node

     if left_index < heap_size and array[largest] < array[left_index]:
          UpperCAmelCase_							:       List[str]       =				left_index

     if right_index < heap_size and array[largest] < array[right_index]:
          UpperCAmelCase_							:       Union[str, Any]       =				right_index

     if largest != index:
          UpperCAmelCase_							:       Optional[Any]       =				array[largest], array[index]
          heapify(__a     ,					__a     ,					__a       )


def  _lowerCamelCase   (				lowerCamelCase_ :							list       ):



     """simple docstring"""





     UpperCAmelCase_							:       Any       =				len(__a       )

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

     for i in range(n - 1     ,					0     ,					-1       ):
          UpperCAmelCase_							:       List[Any]       =				array[0], array[i]
          heapify(__a     ,					0     ,					__a       )

     return array


def  _lowerCamelCase   (				lowerCamelCase_ :							list     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):



     """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  _lowerCamelCase   (				lowerCamelCase_ :							list     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





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


def  _lowerCamelCase   (				lowerCamelCase_ :							list       ):



     """simple docstring"""





     if len(__a       ) == 0:
          return array
     UpperCAmelCase_							:       Optional[Any]       =				2 * math.ceil(math.loga(len(__a       )       )       )
     UpperCAmelCase_							:       Optional[Any]       =				16
     return intro_sort(__a     ,					0     ,					len(__a       )     ,					__a     ,					__a       )


def  _lowerCamelCase   (				lowerCamelCase_ :							list     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





     while end - start > size_threshold:
          if max_depth == 0:
               return heap_sort(__a       )
          max_depth -= 1
          UpperCAmelCase_							:       Dict       =				median_of_a(__a     ,					__a     ,					start + ((end - start) // 2) + 1     ,					end - 1       )
          UpperCAmelCase_							:       Optional[Any]       =				partition(__a     ,					__a     ,					__a     ,					__a       )
          intro_sort(__a     ,					__a     ,					__a     ,					__a     ,					__a       )
          UpperCAmelCase_							:       int       =				p
     return insertion_sort(__a     ,					__a     ,					__a       )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

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



'''simple docstring'''


snake_case__					:      Optional[Any]				      =  tuple[float, float, float]
snake_case__					:      Tuple				      =  tuple[float, float, float]


def  _lowerCamelCase   (				lowerCamelCase_ :							Pointad     ,					lowerCamelCase_ :							Pointad       ):



     """simple docstring"""





     UpperCAmelCase_							:       Any       =				end_pointa[0] - end_pointa[0]
     UpperCAmelCase_							:       Optional[Any]       =				end_pointa[1] - end_pointa[1]
     UpperCAmelCase_							:       Any       =				end_pointa[2] - end_pointa[2]
     return (x, y, z)


def  _lowerCamelCase   (				lowerCamelCase_ :							Vectorad     ,					lowerCamelCase_ :							Vectorad       ):



     """simple docstring"""





     UpperCAmelCase_							:       Optional[Any]       =				ab[1] * ac[2] - ab[2] * ac[1]  # *i
     UpperCAmelCase_							:       Optional[Any]       =				(ab[0] * ac[2] - ab[2] * ac[0]) * -1  # *j
     UpperCAmelCase_							:       Dict       =				ab[0] * ac[1] - ab[1] * ac[0]  # *k
     return (x, y, z)


def  _lowerCamelCase   (				lowerCamelCase_ :							Vectorad     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





     return tuple(round(lowerCamelCase_     ,					lowerCamelCase_       ) for x in vector       ) == (0, 0, 0)





def  _lowerCamelCase   (				lowerCamelCase_ :							Pointad     ,					lowerCamelCase_ :							Pointad     ,					lowerCamelCase_ :							Pointad     ,					lowerCamelCase_ :							int = 10       ):



     """simple docstring"""





     UpperCAmelCase_							:       List[str]       =				create_vector(lowerCamelCase_     ,					lowerCamelCase_       )
     UpperCAmelCase_							:       List[Any]       =				create_vector(lowerCamelCase_     ,					lowerCamelCase_       )
     return is_zero_vector(get_ad_vectors_cross(lowerCamelCase_     ,					lowerCamelCase_       )     ,					lowerCamelCase_       )






