


from math import factorial

class 							a						:




							"""simple docstring"""


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

							def __repr__(				self			:    Optional[int]							)      ->       List[str]:
														return (
														    F'{self.real}+'
														    F'{"+".join(str(lowerCamelCase							)+"E"+str(n+1							)for n,dual in enumerate(self.duals							)							)}'
														)

							def        __snake_case   (				self			:    Any							)      ->       Dict:
														__snake_case						:     Optional[int]									=  self.duals.copy()
														while cur[-1] == 0:
																					cur.pop(-1							)
														return Dual(self.real       ,      lowerCamelCase							)

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

							__UpperCAmelCase       :				Tuple	    =    __add__

							def __sub__(				self			:    Union[str, Any]       ,      lowerCamelCase			:    int							)      ->       List[Any]:
														return self + other * -1

							def __mul__(				self			:    Any       ,      lowerCamelCase			:    Optional[Any]							)      ->       Any:
														if not isinstance(lowerCamelCase       ,      lowerCamelCase							):
																					__snake_case						:     Tuple									=  []
																					for i in self.duals:
																												new_duals.append(i * other							)
																					return Dual(self.real * other       ,      lowerCamelCase							)
														__snake_case						:     Union[str, Any]									=  [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       ,      lowerCamelCase							)

							__UpperCAmelCase       :				Union[str, Any]	    =    __mul__

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

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






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







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


if __name__ == "__main__":
			import doctest

			doctest.testmod()







			def 							lowerCAmelCase_	(   __lowerCamelCase      ):
										return y**2 * y**4

			print(differentiate(f, 9, 2))


def 	lowerCamelCase					(	UpperCamelCase     :				int							)   ->    bool:
		_lowerCamelCase				   =  (1 + 24 * n) ** 0.5
		return ((1 + root) / 6) % 1 == 0


def 	lowerCamelCase					(	UpperCamelCase     :				int = 50_00							)   ->    int:
		_lowerCamelCase				   =  [(i * (3 * i - 1)) // 2 for i in range(1			,       UpperCamelCase							)]
		for i, pentagonal_i in enumerate(UpperCamelCase							):
				for j in range(UpperCamelCase			,       len(UpperCamelCase							)							):
						_lowerCamelCase				   =  pentagonal_nums[j]
						_lowerCamelCase				   =  pentagonal_i + pentagonal_j
						_lowerCamelCase				   =  pentagonal_j - pentagonal_i
						if is_pentagonal(UpperCamelCase							) and is_pentagonal(UpperCamelCase							):
								return b

		return -1


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