
"""simple docstring"""

from __future__ import annotations

from collections.abc import Callable

_A						=			list[list[float | int]]
def 		UpperCAmelCase (		a_,						a_      ):





		'''simple docstring'''


		lowerCamelCase					:      int          =   len(lowerCamelCase_      )
		lowerCamelCase					:      Matrix          =   [[0 for _ in range(size + 1      )] for _ in range(lowerCamelCase_      )]
		lowerCamelCase					:      int
		lowerCamelCase					:      int
		lowerCamelCase					:      int
		lowerCamelCase					:      int
		lowerCamelCase					:      int
		lowerCamelCase					:      float

		for row in range(lowerCamelCase_      ):
				for col in range(lowerCamelCase_      ):
						lowerCamelCase					:      int          =   matrix[row][col]

				lowerCamelCase					:      List[str]          =   vector[row][0]

		lowerCamelCase					:      Tuple          =   0
		lowerCamelCase					:      Optional[Any]          =   0
		while row < size and col < size:
				# pivoting
				lowerCamelCase					:      Dict          =   max((abs(augmented[rowa][col]      ), rowa) for rowa in range(lowerCamelCase_,						lowerCamelCase_      )      )[
				    1
				]
				if augmented[pivot_row][col] == 0:
						col += 1
						continue
				else:
						lowerCamelCase					:      Dict          =   augmented[pivot_row], augmented[row]

				for rowa in range(row + 1,						lowerCamelCase_      ):
						lowerCamelCase					:      str          =   augmented[rowa][col] / augmented[row][col]
						lowerCamelCase					:      Union[str, Any]          =   0
						for cola in range(col + 1,						size + 1      ):
								augmented[rowa][cola] -= augmented[row][cola] * ratio

				row += 1
				col += 1

		# back substitution
		for col in range(1,						lowerCamelCase_      ):
				for row in range(lowerCamelCase_      ):
						lowerCamelCase					:      Union[str, Any]          =   augmented[row][col] / augmented[col][col]
						for cola in range(lowerCamelCase_,						size + 1      ):
								augmented[row][cola] -= augmented[col][cola] * ratio

    # round to get rid of numbers like 2.000000000000004
		return [
		    [round(augmented[row][size] / augmented[row][row],						10      )] for row in range(lowerCamelCase_      )
		]
def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		lowerCamelCase					:      int          =   len(lowerCamelCase_      )
		lowerCamelCase					:      Matrix          =   [[0 for _ in range(lowerCamelCase_      )] for _ in range(lowerCamelCase_      )]
		lowerCamelCase					:      Matrix          =   [[0] for _ in range(lowerCamelCase_      )]
		lowerCamelCase					:      Matrix
		lowerCamelCase					:      int
		lowerCamelCase					:      int
		lowerCamelCase					:      int

		for x_val, y_val in enumerate(lowerCamelCase_      ):
				for col in range(lowerCamelCase_      ):
						lowerCamelCase					:      List[Any]          =   (x_val + 1) ** (size - col - 1)
				lowerCamelCase					:      int          =   y_val

		lowerCamelCase					:      Optional[Any]          =   solve(lowerCamelCase_,						lowerCamelCase_      )

		def interpolated_func(a_      ) -> int:
				return sum(
				    round(coeffs[x_val][0]      ) * (var ** (size - x_val - 1))
				    for x_val in range(lowerCamelCase_      )      )

		return interpolated_func
def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		return (
		    1
		    - variable
		    + variable**2
		    - variable**3
		    + variable**4
		    - variable**5
		    + variable**6
		    - variable**7
		    + variable**8
		    - variable**9
		    + variable**10
		)
def 		UpperCAmelCase (		a_ = question_function,						a_ = 10      ):





		'''simple docstring'''


		lowerCamelCase					:      list[int]          =   [func(lowerCamelCase_      ) for x_val in range(1,						order + 1      )]

		lowerCamelCase					:      list[Callable[[int], int]]          =   [
		    interpolate(data_points[:max_coeff]      ) for max_coeff in range(1,						order + 1      )
		]

		lowerCamelCase					:      int          =   0
		lowerCamelCase					:      Callable[[int], int]
		lowerCamelCase					:      int

		for poly in polynomials:
				lowerCamelCase					:      str          =   1
				while func(lowerCamelCase_      ) == poly(lowerCamelCase_      ):
						x_val += 1

				ret += poly(lowerCamelCase_      )

		return ret


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








"""simple docstring"""

def 		UpperCAmelCase (		a_ = 1000      ):





		'''simple docstring'''


		lowerCamelCase					:      Dict          =   2**power
		lowerCamelCase					:      List[str]          =   str(a_      )
		lowerCamelCase					:      Dict          =   list(a_      )
		lowerCamelCase					:      Optional[Any]          =   0

		for i in list_num:
				sum_of_num += int(a_      )

		return sum_of_num


if __name__ == "__main__":
					_A						=			int(input('Enter the power of 2: ').strip())
					print('2 ^ ', power, ' = ', 2**power)
					_A						=			solution(power)
					print('Sum of the digits is: ', result)






