
"""simple docstring"""






import os





def __A						(   a_ :							str = "input.txt"     )->							int:




		'''simple docstring'''






		with open(os.path.join(os.path.dirname(a_     )		,		a_     )     ) as input_file:
				SCREAMING_SNAKE_CASE       :     Optional[Any]				= [
				    [int(a_     ) for element in line.split(''','''     )]
				    for line in input_file.readlines()
				]

		SCREAMING_SNAKE_CASE       :     Any				= len(a_     )
		SCREAMING_SNAKE_CASE       :     Tuple				= len(matrix[0]     )

		SCREAMING_SNAKE_CASE       :     List[str]				= [[-1 for _ in range(a_     )] for _ in range(a_     )]
		for i in range(a_     ):
				SCREAMING_SNAKE_CASE       :     Union[str, Any]				= matrix[i][0]

		for j in range(1		,		a_     ):
				for i in range(a_     ):
						SCREAMING_SNAKE_CASE       :     Optional[Any]				= minimal_path_sums[i][j - 1] + matrix[i][j]

				for i in range(1		,		a_     ):
						SCREAMING_SNAKE_CASE       :     List[Any]				= min(
						    minimal_path_sums[i][j]		,		minimal_path_sums[i - 1][j] + matrix[i][j]     )

				for i in range(rows - 2		,		-1		,		-1     ):
						SCREAMING_SNAKE_CASE       :     Any				= min(
						    minimal_path_sums[i][j]		,		minimal_path_sums[i + 1][j] + matrix[i][j]     )

		return min(minimal_path_sums_row[-1] for minimal_path_sums_row in minimal_path_sums     )


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







"""simple docstring"""






def __A						(   a_ :							list		,		a_ :							int		,		a_ :							int = 0		,		a_ :							int = 0     )->							int:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     str				= right or len(a_     ) - 1
		if left > right:
				return -1
		elif list_data[left] == key:
				return left
		elif list_data[right] == key:
				return right
		else:
				return search(a_		,		a_		,		left + 1		,		right - 1     )


if __name__ == "__main__":
					import doctest

					doctest.testmod()





