

"""simple docstring"""




from __future__ import annotations

from typing import Any





class 			__UpperCamelCase :


		def __init__(self :		int     ,     __SCREAMING_SNAKE_CASE :		Any     ,     __SCREAMING_SNAKE_CASE :		Any):  # noqa: A002
							A			=					item
							A			=					next





class 			__UpperCamelCase :


		def __init__(self :		Optional[Any]):
							A			=					None
							A			=					0


		def 					SCREAMING_SNAKE_CASE__   (self :		Optional[Any]     ,     __SCREAMING_SNAKE_CASE :		Any):
							A			=					Node(__SCREAMING_SNAKE_CASE     ,     self.head)
							self.size += 1


		def 					SCREAMING_SNAKE_CASE__   (self :		Union[str, Any]):
							# Switched 'self.is_empty()' to 'self.head is None'
							# because mypy was considering the possibility that 'self.head'
							# can be None in below else part and giving error
							if self.head is None:
												return None
							else:
												A			=					self.head.item
												A			=					self.head.next
												self.size -= 1
												return item


		def 					SCREAMING_SNAKE_CASE__   (self :		Optional[int]):
							return self.head is None


		def __str__(self :		Tuple):
							if self.is_empty():
												return ""
							else:
												A			=					self.head
												A			=					""
												A			=					[]
												while iterate:
																	item_list.append(str(iterate.item))
																	A			=					iterate.next

												A			=					" --> ".join(__SCREAMING_SNAKE_CASE)

												return item_str


		def __len__(self :		List[str]):
							return self.size








"""simple docstring"""




def    __SCREAMING_SNAKE_CASE						(						lowercase__			,							lowercase__			,							lowercase__      ):
					"""simple docstring"""
					A			=					index
					A			=					2 * index + 1
					A			=					2 * index + 2
					if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
										A			=					left_index

					if right_index < heap_size and unsorted[right_index] > unsorted[largest]:
										A			=					right_index

					if largest != index:
										A			,    A			=					unsorted[index], unsorted[largest]
										heapify(lowercase__			,							lowercase__			,							lowercase__      )
def    __SCREAMING_SNAKE_CASE						(						lowercase__      ):
					"""simple docstring"""
					A			=					len(lowercase__      )
					for i in range(n // 2 - 1			,							-1			,							-1      ):
										heapify(lowercase__			,							lowercase__			,							lowercase__      )
					for i in range(n - 1			,							0			,							-1      ):
										A			,    A			=					unsorted[i], unsorted[0]
										heapify(lowercase__			,							0			,							lowercase__      )
					return unsorted


if __name__ == "__main__":
	__A     :    List[Any]    =		input('Enter numbers separated by a comma:\n').strip()
	__A     :    List[str]    =		[int(item) for item in user_input.split(',')]
	print(heap_sort(unsorted))





