


'''simple docstring'''







import itertools






def    lowerCAmelCase__ (       lowerCamelCase  :    int = 1000000     ):
       _A  :			str											=      [1]

       for i in itertools.count(len(lowerCamelCase     )     ):
              _A  :			Optional[Any]											=      0
              for j in itertools.count(1     ):
                     _A  :			int											=      -1 if j % 2 == 0 else +1
                     _A  :			Optional[Any]											=      (j * j * 3 - j) // 2
                     if index > i:
                            break
                     item += partitions[i - index] * sign
                     item %= number
                     index += j
                     if index > i:
                            break
                     item += partitions[i - index] * sign
                     item %= number

              if item == 0:
                     return i
              partitions.append(lowerCamelCase     )

       return 0


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(f"""{solution() = }""")










'''simple docstring'''







class 				__lowerCamelCase				:
    """simple docstring"""


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


    def      A					(						self    :							List[Any]   ,							SCREAMING_SNAKE_CASE    :							int):
           _A  :			Optional[Any]											=      self.__heap[i]
           while i // 2 > 0:
                  if self.__heap[i] > self.__heap[i // 2]:
                         _A  :			Dict											=      self.__heap[i // 2]
                         _A  :			Optional[Any]											=      temporary
                  i //= 2


    def      A					(						self    :							List[Any]   ,							SCREAMING_SNAKE_CASE    :							int):
           self.__heap.append(SCREAMING_SNAKE_CASE)
           self.__size += 1
           self.__swap_up(self.__size)


    def      A					(						self    :							int   ,							SCREAMING_SNAKE_CASE    :							int):
           while self.__size >= 2 * i:
                  if 2 * i + 1 > self.__size:
                         _A  :			Optional[int]											=      2 * i
                  else:
                         if self.__heap[2 * i] > self.__heap[2 * i + 1]:
                                _A  :			Any											=      2 * i
                         else:
                                _A  :			Optional[Any]											=      2 * i + 1
                  _A  :			List[str]											=      self.__heap[i]
                  if self.__heap[i] < self.__heap[bigger_child]:
                         _A  :			Union[str, Any]											=      self.__heap[bigger_child]
                         _A  :			Optional[int]											=      temporary
                  _A  :			Any											=      bigger_child


    def      A					(						self    :							List[str]):
           _A  :			str											=      self.__heap[1]
           _A  :			Tuple											=      self.__heap[self.__size]
           self.__size -= 1
           self.__heap.pop()
           self.__swap_down(1)
           return max_value


    @property
    def      A					(						self    :							int):
           return self.__heap[1:]


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


if __name__ == "__main__":
   import doctest

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






