


import math





def   _lowerCAmelCase				(   UpperCamelCase__:     list							,					UpperCamelCase__:     int = 0							,					UpperCamelCase__:     int = 0						) ->   list:





	"""simple docstring"""







	A								=				end or len(UpperCamelCase__						)
	for i in range(UpperCamelCase__							,					UpperCamelCase__						):
		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				(   UpperCamelCase__:     list							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int						) ->   None:  # 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(UpperCamelCase__							,					UpperCamelCase__							,					UpperCamelCase__						)





def   _lowerCAmelCase				(   UpperCamelCase__:     list						) ->   list:





	"""simple docstring"""







	A								=				len(UpperCamelCase__						)

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

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

	return array





def   _lowerCAmelCase				(   UpperCamelCase__:     list							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int						) ->   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				(   UpperCamelCase__:     list							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int						) ->   int:





	"""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   _lowerCAmelCase				(   UpperCamelCase__:     list						) ->   list:





	"""simple docstring"""







	if len(UpperCamelCase__						) == 0:
		return array
	A								=				2 * math.ceil(math.loga(len(UpperCamelCase__						)						)						)
	A								=				16
	return intro_sort(UpperCamelCase__							,					0							,					len(UpperCamelCase__						)							,					UpperCamelCase__							,					UpperCamelCase__						)





def   _lowerCAmelCase				(   UpperCamelCase__:     list							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int							,					UpperCamelCase__:     int						) ->   list:





	"""simple docstring"""







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


if __name__ == "__main__":
				import doctest

				doctest.testmod()

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







def   _lowerCAmelCase				(   UpperCamelCase__:     str						) ->   str:





	"""simple docstring"""







	return " ".join(input_str.split()[::-1]						)


if __name__ == "__main__":
				import doctest

				doctest.testmod()



