





"""simple docstring"""


from __future__ import annotations

def      UpperCamelCase							(SCREAMING_SNAKE_CASE     ):

						# preprocessing the first row
						for i in range(1							,     len(matrix[0]     )     ):
												matrix[0][i] += matrix[0][i - 1]

						# preprocessing the first column
						for i in range(1							,     len(SCREAMING_SNAKE_CASE     )     ):
												matrix[i][0] += matrix[i - 1][0]

						# updating the path cost for current position
						for i in range(1							,     len(SCREAMING_SNAKE_CASE     )     ):
												for j in range(1							,     len(matrix[0]     )     ):
																		matrix[i][j] += min(matrix[i - 1][j]							,     matrix[i][j - 1]     )

						return matrix[-1][-1]


if __name__ == "__main__":
		import doctest

		doctest.testmod()






def 			lowerCAmelCase(      SCREAMING_SNAKE_CASE_			,						SCREAMING_SNAKE_CASE_			,						SCREAMING_SNAKE_CASE_			)->						int:



    """simple docstring"""






    if exponent == 1:
        return base
    if exponent % 2 == 0:
        UpperCamelCase_			  =						_modexpt(SCREAMING_SNAKE_CASE_			,						exponent // 2			,						SCREAMING_SNAKE_CASE_			) % modulo_value
        return (x * x) % modulo_value
    else:
        return (base * _modexpt(SCREAMING_SNAKE_CASE_			,						exponent - 1			,						SCREAMING_SNAKE_CASE_			)) % modulo_value




def 			lowerCAmelCase(      SCREAMING_SNAKE_CASE_ = 1_7_7_7			,						SCREAMING_SNAKE_CASE_ = 1_8_5_5			,						SCREAMING_SNAKE_CASE_ = 8			)->						int:



    """simple docstring"""






    UpperCamelCase_			  =						base
    for _ in range(1			,						SCREAMING_SNAKE_CASE_			):
        UpperCamelCase_			  =						_modexpt(SCREAMING_SNAKE_CASE_			,						SCREAMING_SNAKE_CASE_			,						1_0**digits			)

    return result


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