






"""simple docstring"""


import math


def        UpperCAmelCase      (					a__     ,      a__ = 0     ,      a__ = 0 ):





						'''simple docstring'''






						lowerCAmelCase   :Any						=			end or len(a__ )
						for i in range(a__     ,      a__ ):
												lowerCAmelCase   :str						=			i
												lowerCAmelCase   :Tuple						=			array[i]
												while temp_index != start and temp_index_value < array[temp_index - 1]:
																		lowerCAmelCase   :Union[str, Any]						=			array[temp_index - 1]
																		temp_index -= 1
												lowerCAmelCase   :List[Any]						=			temp_index_value
						return array


def        UpperCAmelCase      (					a__     ,      a__     ,      a__ ):  # Max Heap





						'''simple docstring'''






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

						if left_index < heap_size and array[largest] < array[left_index]:
												lowerCAmelCase   :Any						=			left_index

						if right_index < heap_size and array[largest] < array[right_index]:
												lowerCAmelCase   :Optional[Any]						=			right_index

						if largest != index:
												lowerCAmelCase	, lowerCAmelCase   :str						=			array[largest], array[index]
												heapify(a__     ,      a__     ,      a__ )


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






						lowerCAmelCase   :Union[str, Any]						=			len(a__ )

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

						for i in range(n - 1     ,      0     ,      -1 ):
												lowerCAmelCase	, lowerCAmelCase   :Union[str, Any]						=			array[0], array[i]
												heapify(a__     ,      0     ,      a__ )

						return array


def        UpperCAmelCase      (					a__     ,      a__     ,      a__     ,      a__ ):





						'''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      (					a__     ,      a__     ,      a__     ,      a__ ):





						'''simple docstring'''






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


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






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


def        UpperCAmelCase      (					a__     ,      a__     ,      a__     ,      a__     ,      a__ ):





						'''simple docstring'''






						while end - start > size_threshold:
												if max_depth == 0:
																		return heap_sort(a__ )
												max_depth -= 1
												lowerCAmelCase   :int						=			median_of_a(a__     ,      a__     ,      start + ((end - start) // 2) + 1     ,      end - 1 )
												lowerCAmelCase   :Union[str, Any]						=			partition(a__     ,      a__     ,      a__     ,      a__ )
												intro_sort(a__     ,      a__     ,      a__     ,      a__     ,      a__ )
												lowerCAmelCase   :Tuple						=			p
						return insertion_sort(a__     ,      a__     ,      a__ )


if __name__ == "__main__":
		import doctest

		doctest.testmod()

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







"""simple docstring"""


import heapq as hq
import math
from collections.abc import Iterator




class 						__UpperCamelCase     :
					def __init__(							self							:	Union[str, Any]     , UpperCAmelCase							:	List[Any]   )	->       List[str]:
											lowerCAmelCase   :Dict						=			str(id_   )
											lowerCAmelCase   :str						=			None
											lowerCAmelCase   :Any						=			None
											lowerCAmelCase   :List[str]						=			[]
											lowerCAmelCase   :List[Any]						=			{}  # {vertex:distance}
					def __lt__(							self							:	Union[str, Any]     , UpperCAmelCase							:	Any   )	->       str:
											return self.key < other.key
					def __repr__(							self							:	Union[str, Any]   )	->       Dict:
											return self.id
					def        UpperCAmelCase__ (							self							:	Any     , UpperCAmelCase							:	Tuple   )	->       List[str]:
											self.neighbors.append(UpperCAmelCase   )
					def        UpperCAmelCase__ (							self							:	str     , UpperCAmelCase							:	Optional[Any]     , UpperCAmelCase							:	List[Any]   )	->       Optional[int]:
											lowerCAmelCase   :str						=			weight


def        UpperCAmelCase      (					a__     ,      a__     ,      a__     ,      a__ ):





						'''simple docstring'''






						graph[a - 1].add_neighbor(graph[b - 1] )
						graph[b - 1].add_neighbor(graph[a - 1] )
						# add the edges:
						graph[a - 1].add_edge(graph[b - 1]     ,      a__ )
						graph[b - 1].add_edge(graph[a - 1]     ,      a__ )


def        UpperCAmelCase      (					a__     ,      a__ ):





						'''simple docstring'''






						lowerCAmelCase   :List[str]						=			[]
						for u in graph:
												lowerCAmelCase   :Tuple						=			math.inf
												lowerCAmelCase   :Any						=			None
						lowerCAmelCase   :Dict						=			0
						lowerCAmelCase   :int						=			graph[:]
						while q:
												lowerCAmelCase   :str						=			min(a__ )
												q.remove(a__ )
												for v in u.neighbors:
																		if (v in q) and (u.edges[v.id] < v.key):
																								lowerCAmelCase   :List[str]						=			u
																								lowerCAmelCase   :List[Any]						=			u.edges[v.id]
						for i in range(1     ,      len(a__ ) ):
												a.append((int(graph[i].id ) + 1, int(graph[i].pi.id ) + 1) )
						return a


def        UpperCAmelCase      (					a__     ,      a__ ):





						'''simple docstring'''






						for u in graph:
												lowerCAmelCase   :List[str]						=			math.inf
												lowerCAmelCase   :str						=			None
						lowerCAmelCase   :Optional[int]						=			0

						lowerCAmelCase   :Dict						=			list(a__ )
						hq.heapify(a__ )

						while h:
												lowerCAmelCase   :Union[str, Any]						=			hq.heappop(a__ )
												for v in u.neighbors:
																		if (v in h) and (u.edges[v.id] < v.key):
																								lowerCAmelCase   :int						=			u
																								lowerCAmelCase   :List[Any]						=			u.edges[v.id]
																								hq.heapify(a__ )

						for i in range(1     ,      len(a__ ) ):
												yield (int(graph[i].id ) + 1, int(graph[i].pi.id ) + 1)


def        UpperCAmelCase      (					):





						'''simple docstring'''








if __name__ == "__main__":
		import doctest

		doctest.testmod()