






"""simple docstring"""






import math



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__ = 0       ,lowerCAmelCase__ = 0				):
    A__							 =       end or len(_lowerCamelCase				)
    for i in range(_lowerCamelCase       ,_lowerCamelCase				):
        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  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):  # Max Heap
    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__							 =       array[largest], array[index]
        heapify(_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase				)



def  __lowerCamelCase					(					lowerCAmelCase__				):
    A__							 =       len(_lowerCamelCase				)

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

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

    return array



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):
    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__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):
    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__							 =       array[j], array[i]
        i += 1



def  __lowerCamelCase					(					lowerCAmelCase__				):
    if len(_lowerCamelCase				) == 0:
        return array
    A__							 =       2 * math.ceil(math.loga(len(_lowerCamelCase				)				)				)
    A__							 =       16
    return intro_sort(_lowerCamelCase       ,0       ,len(_lowerCamelCase				)       ,_lowerCamelCase       ,_lowerCamelCase				)



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):
    while end - start > size_threshold:
        if max_depth == 0:
            return heap_sort(_lowerCamelCase				)
        max_depth -= 1
        A__							 =       median_of_a(_lowerCamelCase       ,_lowerCamelCase       ,start + ((end - start) // 2) + 1       ,end - 1				)
        A__							 =       partition(_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase				)
        intro_sort(_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase				)
        A__							 =       p
    return insertion_sort(_lowerCamelCase       ,_lowerCamelCase       ,_lowerCamelCase				)


if __name__ == "__main__":
     import doctest

     doctest.testmod()

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










"""simple docstring"""






from math import factorial, pi



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__ = 30				):

				if not isinstance(lowerCAmelCase__       ,(int, float)				):
								raise ValueError('maclaurin_sin() requires either an int or float for theta'				)

				if not isinstance(lowerCAmelCase__       ,lowerCAmelCase__				) or accuracy <= 0:
								raise ValueError('maclaurin_sin() requires a positive int for accuracy'				)

				A__							 =       float(lowerCAmelCase__				)
				A__							 =       theta // (2 * pi)
				theta -= 2 * div * pi
				return sum(
				    (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1				) for r in range(lowerCAmelCase__				)				)



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__ = 30				):

				if not isinstance(lowerCAmelCase__       ,(int, float)				):
								raise ValueError('maclaurin_cos() requires either an int or float for theta'				)

				if not isinstance(lowerCAmelCase__       ,lowerCAmelCase__				) or accuracy <= 0:
								raise ValueError('maclaurin_cos() requires a positive int for accuracy'				)

				A__							 =       float(lowerCAmelCase__				)
				A__							 =       theta // (2 * pi)
				theta -= 2 * div * pi
				return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r				) for r in range(lowerCAmelCase__				)				)


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					print(maclaurin_sin(10))
					print(maclaurin_sin(-10))
					print(maclaurin_sin(10, 15))
					print(maclaurin_sin(-10, 15))

					print(maclaurin_cos(5))
					print(maclaurin_cos(-5))
					print(maclaurin_cos(10, 15))
					print(maclaurin_cos(-10, 15))


