





class 			__A:

     def __init__(   self   ):





            """simple docstring"""

            _UpperCamelCase														=    [0]
            _UpperCamelCase														=    0

     def 						_UpperCamelCase  (   self,							A   ):





            """simple docstring"""

            _UpperCamelCase														=    self.__heap[i]
            while i // 2 > 0:
                   if self.__heap[i] > self.__heap[i // 2]:
                          _UpperCamelCase														=    self.__heap[i // 2]
                          _UpperCamelCase														=    temporary
                   i //= 2

     def 						_UpperCamelCase  (   self,							A   ):





            """simple docstring"""

            self.__heap.append(A__   )
            self.__size += 1
            self.__swap_up(self.__size   )

     def 						_UpperCamelCase  (   self,							A   ):





            """simple docstring"""

            while self.__size >= 2 * i:
                   if 2 * i + 1 > self.__size:
                          _UpperCamelCase														=    2 * i
                   else:
                          if self.__heap[2 * i] > self.__heap[2 * i + 1]:
                                 _UpperCamelCase														=    2 * i
                          else:
                                 _UpperCamelCase														=    2 * i + 1
                   _UpperCamelCase														=    self.__heap[i]
                   if self.__heap[i] < self.__heap[bigger_child]:
                          _UpperCamelCase														=    self.__heap[bigger_child]
                          _UpperCamelCase														=    temporary
                   _UpperCamelCase														=    bigger_child

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            _UpperCamelCase														=    self.__heap[1]
            _UpperCamelCase														=    self.__heap[self.__size]
            self.__size -= 1
            self.__heap.pop()
            self.__swap_down(1   )
            return max_value

     @property
     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            return self.__heap[1:]



     def __len__(   self   ):





            """simple docstring"""

            return self.__size


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       # create an instance of BinaryHeap
       lowercase     :			Tuple     						=	BinaryHeap()
       binary_heap.insert(6)
       binary_heap.insert(10)
       binary_heap.insert(15)
       binary_heap.insert(12)
       # pop root(max-values because it is max heap)
       print(binary_heap.pop())  # 15
       print(binary_heap.pop())  # 12
       # get the list and size after operations
       print(binary_heap.get_list)
       print(len(binary_heap))









def  snake_case_(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase	)				->      Optional[Any]:



  """simple docstring"""






  _snake_case		=				index
  _snake_case		=				2 * index + 1
  _snake_case		=				2 * index + 2
  if left_index < heap_size and unsorted[left_index] > unsorted[largest]:
    _snake_case		=				left_index

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

  if largest != index:
    _snake_case,	_snake_case		=				unsorted[index], unsorted[largest]
    heapify(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase	)



def  snake_case_(_UpperCamelCase	)				->      Any:



  """simple docstring"""






  _snake_case		=				len(_UpperCamelCase	)
  for i in range(n // 2 - 1					,			-1					,			-1	):
    heapify(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase	)
  for i in range(n - 1					,			0					,			-1	):
    _snake_case,	_snake_case		=				unsorted[i], unsorted[0]
    heapify(_UpperCamelCase					,			0					,			_UpperCamelCase	)
  return unsorted


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

