


'''simple docstring'''

class 							lowercase_    :







    def __init__(	self				)				->       List[Any]:





     """simple docstring"""

     UpperCAmelCase_				       =					[0]
     UpperCAmelCase_				       =					0







    def   lowerCamelCase_    (	self       ,     UpperCamelCase__				)				->       None:





     """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   lowerCamelCase_    (	self       ,     UpperCamelCase__				)				->       None:





     """simple docstring"""

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







    def   lowerCamelCase_    (	self       ,     UpperCamelCase__				)				->       None:





     """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   lowerCamelCase_    (	self				)				->       int:





     """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   lowerCamelCase_    (	self				)				->       List[str]:





     """simple docstring"""

     return self.__heap[1:]







    def __len__(	self				)				->       Optional[Any]:





     """simple docstring"""

     return self.__size


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      # create an instance of BinaryHeap
      __snake_case       :   Dict  		=    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))

'''simple docstring'''

def lowerCamelCase__						(       A_       ):
 UpperCAmelCase_				       =					len(A_       )
 for _ in range(
     0       ,			int(((no_of_elements - 1) / 2) + 1       )       ):  # we don't need to traverse to end of list as
  for j in range(0       ,			no_of_elements - 1       ):
   if (
       lst[j + 1] < lst[j]
   ):  # applying bubble sort algorithm from left to right (or forwards)
    UpperCAmelCase_				       =					lst[j + 1]
    UpperCAmelCase_				       =					lst[j]
    UpperCAmelCase_				       =					temp
   if (
       lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
   ):  # applying bubble sort algorithm from right to left (or backwards)
    UpperCAmelCase_				       =					lst[no_of_elements - 1 - j]
    UpperCAmelCase_				       =					lst[no_of_elements - 2 - j]
    UpperCAmelCase_				       =					temp
 return lst


if __name__ == "__main__":
      print('''enter the list to be sorted''')
      __snake_case       :   List[str]  		=    [int(x) for x in input().split()]  # inputing elements of the list in one line
      __snake_case       :   Optional[int]  		=    double_sort(lst)
      print('''the sorted list is''')
      print(sorted_lst)
