




from collections.abc import Callable
class  __a   :


     """simple docstring"""


     def __init__(      self     :					Union[str, Any]							,_UpperCamelCase     :					Optional[Any] = None		)						->  None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =[]
         # Stores indexes of each item for supporting updates and deletion.
         SCREAMING_SNAKE_CASE__        ={}
         # Stores current size of heap.
         SCREAMING_SNAKE_CASE__        =0
         # Stores function used to evaluate the score of an item on which basis ordering
         # will be done.
         SCREAMING_SNAKE_CASE__        =key or (lambda _UpperCamelCase		: x)




     def     __A							(      self     :					Optional[int]							,_UpperCamelCase     :					Tuple		)						->  int | None:


         '''simple docstring'''





         return int((i - 1) / 2		) if i > 0 else None




     def     __A							(      self     :					Tuple							,_UpperCamelCase     :					Optional[int]		)						->  int | None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =int(2 * i + 1		)
         return left if 0 < left < self.size else None




     def     __A							(      self     :					Tuple							,_UpperCamelCase     :					str		)						->  int | None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =int(2 * i + 2		)
         return right if 0 < right < self.size else None




     def     __A							(      self     :					Tuple							,_UpperCamelCase     :					int							,_UpperCamelCase     :					List[Any]		)						->  None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__     ,						SCREAMING_SNAKE_CASE__        =(
             self.pos_map[self.arr[j][0]],
             self.pos_map[self.arr[i][0]],
         )
         # Then swap the items in the list.
         SCREAMING_SNAKE_CASE__     ,						SCREAMING_SNAKE_CASE__        =self.arr[j], self.arr[i]




     def     __A							(      self     :					int							,_UpperCamelCase     :					Optional[int]							,_UpperCamelCase     :					Optional[Any]		)						->  bool:


         '''simple docstring'''





         return self.arr[i][1] < self.arr[j][1]




     def     __A							(      self     :					Dict							,_UpperCamelCase     :					Dict		)						->  int:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =self._left(a_		)
         SCREAMING_SNAKE_CASE__        =self._right(a_		)
         SCREAMING_SNAKE_CASE__        =i

         if left is not None and not self._cmp(a_							,a_		):
             SCREAMING_SNAKE_CASE__        =left
         if right is not None and not self._cmp(a_							,a_		):
             SCREAMING_SNAKE_CASE__        =right

         return valid_parent




     def     __A							(      self     :					str							,_UpperCamelCase     :					List[str]		)						->  None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =self._parent(a_		)
         while parent is not None and not self._cmp(a_							,a_		):
             self._swap(a_							,a_		)
             SCREAMING_SNAKE_CASE__     ,						SCREAMING_SNAKE_CASE__        =parent, self._parent(a_		)




     def     __A							(      self     :					Optional[int]							,_UpperCamelCase     :					List[str]		)						->  None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =self._get_valid_parent(a_		)
         while valid_parent != index:
             self._swap(a_							,a_		)
             SCREAMING_SNAKE_CASE__     ,						SCREAMING_SNAKE_CASE__        =valid_parent, self._get_valid_parent(a_		)




     def     __A							(      self     :					str							,_UpperCamelCase     :					List[Any]							,_UpperCamelCase     :					Any		)						->  None:


         '''simple docstring'''





         if item not in self.pos_map:
             return
         SCREAMING_SNAKE_CASE__        =self.pos_map[item]
         SCREAMING_SNAKE_CASE__        =[item, self.key(a_		)]
         # Make sure heap is right in both up and down direction.
         # Ideally only one of them will make any change.
         self._heapify_up(a_		)
         self._heapify_down(a_		)




     def     __A							(      self     :					Any							,_UpperCamelCase     :					str		)						->  None:


         '''simple docstring'''





         if item not in self.pos_map:
             return
         SCREAMING_SNAKE_CASE__        =self.pos_map[item]
         del self.pos_map[item]
         SCREAMING_SNAKE_CASE__        =self.arr[self.size - 1]
         SCREAMING_SNAKE_CASE__        =index
         self.size -= 1
         # Make sure heap is right in both up and down direction. Ideally only one
         # of them will make any change- so no performance loss in calling both.
         if self.size > index:
             self._heapify_up(a_		)
             self._heapify_down(a_		)




     def     __A							(      self     :					Any							,_UpperCamelCase     :					Any							,_UpperCamelCase     :					int		)						->  None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =len(self.arr		)
         if arr_len == self.size:
             self.arr.append([item, self.key(a_		)]		)
         else:
             SCREAMING_SNAKE_CASE__        =[item, self.key(a_		)]
         SCREAMING_SNAKE_CASE__        =self.size
         self.size += 1
         self._heapify_up(self.size - 1		)




     def     __A							(      self     :					List[str]		)						->  tuple | None:


         '''simple docstring'''





         return self.arr[0] if self.size else None




     def     __A							(      self     :					Any		)						->  tuple | None:


         '''simple docstring'''





         SCREAMING_SNAKE_CASE__        =self.get_top()
         if top_item_tuple:
             self.delete_item(top_item_tuple[0]		)
         return top_item_tuple






def       UpperCAmelCase_       (      ):
    pass


if __name__ == "__main__":
    import doctest

    doctest.testmod()









'''simple docstring'''




def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : int = 1000    ):
  UpperCAmelCase    				=						-1
  UpperCAmelCase    				=						0
  for a in range(1							, n // 3    ):
    # Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c
    UpperCAmelCase    				=						(n * n - 2 * a * n) // (2 * n - 2 * a)
    UpperCAmelCase    				=						n - a - b
    if c * c == (a * a + b * b):
      UpperCAmelCase    				=						a * b * c
      if candidate >= product:
        UpperCAmelCase    				=						candidate
  return product


if __name__ == "__main__":
  print(F'''{solution() = }''')


