

"""simple docstring"""

class  __a				:





       """simple docstring"""


       def __init__(      self      ):





        """simple docstring"""

        lowerCAmelCase__      :							Dict    =							[0]
        lowerCAmelCase__      :							int    =							0






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							Any    =							self.__heap[i]
        while i // 2 > 0:
         if self.__heap[i] > self.__heap[i // 2]:
          lowerCAmelCase__      :							str    =							self.__heap[i // 2]
          lowerCAmelCase__      :							Dict    =							temporary
         i //= 2






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

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






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

        while self.__size >= 2 * i:
         if 2 * i + 1 > self.__size:
          lowerCAmelCase__      :							Tuple    =							2 * i
         else:
          if self.__heap[2 * i] > self.__heap[2 * i + 1]:
           lowerCAmelCase__      :							Dict    =							2 * i
          else:
           lowerCAmelCase__      :							Dict    =							2 * i + 1
         lowerCAmelCase__      :							Optional[int]    =							self.__heap[i]
         if self.__heap[i] < self.__heap[bigger_child]:
          lowerCAmelCase__      :							List[Any]    =							self.__heap[bigger_child]
          lowerCAmelCase__      :							Optional[Any]    =							temporary
         lowerCAmelCase__      :							List[Any]    =							bigger_child






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        lowerCAmelCase__      :							str    =							self.__heap[1]
        lowerCAmelCase__      :							Dict    =							self.__heap[self.__size]
        self.__size -= 1
        self.__heap.pop()
        self.__swap_down(1      )
        return max_value






       @property
       def  SCREAMING_SNAKE_CASE_  (      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
    _UpperCamelCase		    =						BinaryHeap()
    binary_heap.insert(6)
    binary_heap.insert(1_0)
    binary_heap.insert(1_5)
    binary_heap.insert(1_2)
    # 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 			SCREAMING_SNAKE_CASE       (   lowercase__      ) ->	int:
 return 1 if input_a == 0 else 0



def 			SCREAMING_SNAKE_CASE       (   ) ->	None:
 assert not_gate(0      ) == 1
 assert not_gate(1      ) == 0


if __name__ == "__main__":
    print(not_gate(0))
    print(not_gate(1))






