



'''simple docstring'''





import os





def 		__snake_case(							_lowerCAmelCase = "input.txt"						)						->					Tuple:





      with open(os.path.join(os.path.dirname(_A						)	,  _A						)						) as input_file:
            snake_case__    :       str       		= [
                [int(_A						) for element in line.split(""","""						)]
                for line in input_file.readlines()
            ]

      snake_case__    :       Optional[int]       		= len(_A						)
      snake_case__    :       Optional[Any]       		= len(matrix[0]						)

      snake_case__    :       Union[str, Any]       		= [[-1 for _ in range(_A						)] for _ in range(_A						)]
      for i in range(_A						):
            snake_case__    :       Any       		= matrix[i][0]

      for j in range(1	,  _A						):
            for i in range(_A						):
                  snake_case__    :       Optional[int]       		= minimal_path_sums[i][j - 1] + matrix[i][j]

            for i in range(1	,  _A						):
                  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						):
                  snake_case__    :       str       		= 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() = }")






def 		lowerCamelCase__       (						_A	,      _A				):







	'''simple docstring'''





	_validate_point(_A				)
	_validate_point(_A				)
	if len(_A				) != len(_A				):
		raise ValueError("Both points must be in the same n-dimensional space"				)

	return float(sum(abs(a - b				) for a, b in zip(_A	,      _A				)				)				)


def 		lowerCamelCase__       (						_A				):







	'''simple docstring'''





	if point:
		if isinstance(_A	,      _A				):
			for item in point:
				if not isinstance(_A	,      (int, float)				):
					snake_case_						       =	(
					    "Expected a list of numbers as input, found "
					    f"{type(_A				).__name__}"
					)
					raise TypeError(_A				)
		else:
			snake_case_						       =	f"Expected a list of numbers as input, found {type(_A				).__name__}"
			raise TypeError(_A				)
	else:
		raise ValueError("Missing an input"				)


def 		lowerCamelCase__       (						_A	,      _A				):







	'''simple docstring'''





	_validate_point(_A				)
	_validate_point(_A				)
	if len(_A				) != len(_A				):
		raise ValueError("Both points must be in the same n-dimensional space"				)

	return float(sum(abs(x - y				) for x, y in zip(_A	,      _A				)				)				)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
