from math import factorial


class      lowerCamelCase    :
  """simple docstring"""







  def __init__(							self       :				Dict     ,   __magic_name__       :				Optional[int]     ,   __magic_name__       :				List[str]      )     ->		List[Any]:
        SCREAMING_SNAKE_CASE_      =     real
        if isinstance(__magic_name__     ,   __magic_name__      ):
              SCREAMING_SNAKE_CASE_      =     [1] * rank
        else:
              SCREAMING_SNAKE_CASE_      =     rank







  def __repr__(							self       :				Any      )     ->		str:
        return (
            F'''{self.real}+'''
            F'''{"+".join(str(__magic_name__      )+"E"+str(n+1      )for n,dual in enumerate(self.duals      )      )}'''
        )







  def       __A   (							self       :				Dict      )     ->		str:
        SCREAMING_SNAKE_CASE_      =     self.duals.copy()
        while cur[-1] == 0:
              cur.pop(-1      )
        return Dual(self.real     ,   __magic_name__      )







  def __add__(							self       :				int     ,   __magic_name__       :				Dict      )     ->		Union[str, Any]:
        if not isinstance(__magic_name__     ,   __magic_name__      ):
              return Dual(self.real + other     ,   self.duals      )
        SCREAMING_SNAKE_CASE_      =     self.duals.copy()
        SCREAMING_SNAKE_CASE_      =     other.duals.copy()
        if len(__magic_name__      ) > len(__magic_name__      ):
              o_dual.extend([1] * (len(__magic_name__      ) - len(__magic_name__      ))      )
        elif len(__magic_name__      ) < len(__magic_name__      ):
              s_dual.extend([1] * (len(__magic_name__      ) - len(__magic_name__      ))      )
        SCREAMING_SNAKE_CASE_      =     []
        for i in range(len(__magic_name__      )      ):
              new_duals.append(s_dual[i] + o_dual[i]      )
        return Dual(self.real + other.real     ,   __magic_name__      )

  lowerCamelCase__   =  __add__







  def __sub__(							self       :				List[Any]     ,   __magic_name__       :				Dict      )     ->		Optional[Any]:
        return self + other * -1







  def __mul__(							self       :				List[Any]     ,   __magic_name__       :				int      )     ->		str:
        if not isinstance(__magic_name__     ,   __magic_name__      ):
              SCREAMING_SNAKE_CASE_      =     []
              for i in self.duals:
                    new_duals.append(i * other      )
              return Dual(self.real * other     ,   __magic_name__      )
        SCREAMING_SNAKE_CASE_      =     [0] * (len(self.duals      ) + len(other.duals      ) + 1)
        for i, item in enumerate(self.duals      ):
              for j, jtem in enumerate(other.duals      ):
                    new_duals[i + j + 1] += item * jtem
        for k in range(len(self.duals      )      ):
              new_duals[k] += self.duals[k] * other.real
        for index in range(len(other.duals      )      ):
              new_duals[index] += other.duals[index] * self.real
        return Dual(self.real * other.real     ,   __magic_name__      )

  lowerCamelCase__   =  __mul__







  def __truediv__(							self       :				Tuple     ,   __magic_name__       :				Any      )     ->		Optional[int]:
        if not isinstance(__magic_name__     ,   __magic_name__      ):
              SCREAMING_SNAKE_CASE_      =     []
              for i in self.duals:
                    new_duals.append(i / other      )
              return Dual(self.real / other     ,   __magic_name__      )
        raise ValueError







  def __floordiv__(							self       :				Union[str, Any]     ,   __magic_name__       :				List[Any]      )     ->		Tuple:
        if not isinstance(__magic_name__     ,   __magic_name__      ):
              SCREAMING_SNAKE_CASE_      =     []
              for i in self.duals:
                    new_duals.append(i // other      )
              return Dual(self.real // other     ,   __magic_name__      )
        raise ValueError







  def __pow__(							self       :				Optional[Any]     ,   __magic_name__       :				Optional[Any]      )     ->		List[str]:
        if n < 0 or isinstance(__magic_name__     ,   __magic_name__      ):
              raise ValueError("power must be a positive integer"      )
        if n == 0:
              return 1
        if n == 1:
              return self
        SCREAMING_SNAKE_CASE_      =     self
        for _ in range(n - 1      ):
              x *= self
        return x



def    a__       (						__UpperCamelCase   ,					__UpperCamelCase   ,					__UpperCamelCase ):
      if not callable(__UpperCamelCase ):
            raise ValueError("differentiate() requires a function as input for func" )
      if not isinstance(__UpperCamelCase   ,					(float, int) ):
            raise ValueError("differentiate() requires a float as input for position" )
      if not isinstance(__UpperCamelCase   ,					__UpperCamelCase ):
            raise ValueError("differentiate() requires an int as input for order" )
      SCREAMING_SNAKE_CASE_      =     Dual(__UpperCamelCase   ,					1 )
      SCREAMING_SNAKE_CASE_      =     func(__UpperCamelCase )
      if order == 0:
            return result.real
      return result.duals[order - 1] * factorial(__UpperCamelCase )


if __name__ == "__main__":
      import doctest

      doctest.testmod()


      def    a__       (						__UpperCamelCase ):
            return y**2 * y**4





      print(differentiate(f, 9, 2))



def    a__       (						__UpperCamelCase = 1_0_0_0 ):
      SCREAMING_SNAKE_CASE_      =     -1
      SCREAMING_SNAKE_CASE_      =     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
            SCREAMING_SNAKE_CASE_      =     (n * n - 2 * a * n) // (2 * n - 2 * a)
            SCREAMING_SNAKE_CASE_      =     n - a - b
            if c * c == (a * a + b * b):
                  SCREAMING_SNAKE_CASE_      =     a * b * c
                  if candidate >= product:
                        SCREAMING_SNAKE_CASE_      =     candidate
      return product


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


