






"""simple docstring"""



from math import factorial






class 							__SCREAMING_SNAKE_CASE						:


							def __init__(			self      :						int			,    snake_case      :						Tuple			,    snake_case      :						Tuple							):
													'''simple docstring'''





													A__						:  int		  =  real
													if isinstance(snake_case			,    snake_case							):
																			A__						:  Optional[int]		  =  [1] * rank
													else:
																			A__						:  Tuple		  =  rank


							def __repr__(			self      :						Any							):
													'''simple docstring'''





													return (
													    F'{self.real}+'
													    F'{"+".join(str(snake_case							)+"E"+str(n+1							)for n,dual in enumerate(self.duals							)							)}'
													)


							def 						_UpperCamelCase       (			self      :						str							):
													'''simple docstring'''





													A__						:  Union[str, Any]		  =  self.duals.copy()
													while cur[-1] == 0:
																			cur.pop(-1							)
													return Dual(self.real			,    snake_case							)


							def __add__(			self      :						Any			,    snake_case      :						int							):
													'''simple docstring'''





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

							snake_case_     =							__add__


							def __sub__(			self      :						Dict			,    snake_case      :						Tuple							):
													'''simple docstring'''





													return self + other * -1


							def __mul__(			self      :						int			,    snake_case      :						str							):
													'''simple docstring'''





													if not isinstance(snake_case			,    snake_case							):
																			A__						:  Dict		  =  []
																			for i in self.duals:
																									new_duals.append(i * other							)
																			return Dual(self.real * other			,    snake_case							)
													A__						:  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			,    snake_case							)

							snake_case_     =							__mul__


							def __truediv__(			self      :						Dict			,    snake_case      :						Tuple							):
													'''simple docstring'''





													if not isinstance(snake_case			,    snake_case							):
																			A__						:  Optional[int]		  =  []
																			for i in self.duals:
																									new_duals.append(i / other							)
																			return Dual(self.real / other			,    snake_case							)
													raise ValueError


							def __floordiv__(			self      :						Union[str, Any]			,    snake_case      :						str							):
													'''simple docstring'''





													if not isinstance(snake_case			,    snake_case							):
																			A__						:  Tuple		  =  []
																			for i in self.duals:
																									new_duals.append(i // other							)
																			return Dual(self.real // other			,    snake_case							)
													raise ValueError


							def __pow__(			self      :						str			,    snake_case      :						Tuple							):
													'''simple docstring'''





													if n < 0 or isinstance(snake_case			,    snake_case							):
																			raise ValueError("""power must be a positive integer"""							)
													if n == 0:
																			return 1
													if n == 1:
																			return self
													A__						:  int		  =  self
													for _ in range(n - 1							):
																			x *= self
													return x




def      _lowerCAmelCase		(							UpperCAmelCase__       :					Any,						UpperCAmelCase__       :					Optional[int],						UpperCAmelCase__       :					int      )		->Tuple:
						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"""      )
						A__						:  Union[str, Any]		  =  Dual(UpperCAmelCase__,						1      )
						A__						:  Optional[int]		  =  func(UpperCAmelCase__      )
						if order == 0:
												return result.real
						return result.duals[order - 1] * factorial(UpperCAmelCase__      )


if __name__ == "__main__":
						import doctest

						doctest.testmod()




						def      _lowerCAmelCase		(							UpperCAmelCase__       :					Dict      )		->Any:
												return y**2 * y**4

						print(differentiate(f, 9, 2))














"""simple docstring"""



from __future__ import annotations

A_    =							10




def      _lowerCAmelCase		(							UpperCAmelCase__       :					list[int]      )		->list[int]:
						A__						:  Any		  =  1
						A__						:  Optional[int]		  =  max(UpperCAmelCase__      )
						while placement <= max_digit:
												# declare and initialize empty buckets
												A__						:  list[list]		  =  [[] for _ in range(UpperCAmelCase__      )]
												# split list_of_ints between the buckets
												for i in list_of_ints:
																		A__						:  List[Any]		  =  int((i / placement) % RADIX      )
																		buckets[tmp].append(UpperCAmelCase__      )
												# put each buckets' contents into list_of_ints
												A__						:  Union[str, Any]		  =  0
												for b in range(UpperCAmelCase__      ):
																		for i in buckets[b]:
																								A__						:  str		  =  i
																								a += 1
        # move to next
												placement *= RADIX
						return list_of_ints


if __name__ == "__main__":
						import doctest

						doctest.testmod()






