




'''simple docstring'''




import os

def _lowercase	(      lowerCamelCase__ = "matrix.txt"						)					->       int:





       """simple docstring"""


       with open(os.path.join(os.path.dirname(lowerCamelCase__						)							,    lowerCamelCase__						)						) as in_file:
              __UpperCAmelCase  :				str       				=		in_file.read()

       __UpperCAmelCase  :				Union[str, Any]       				=		[[int(lowerCamelCase__						) for cell in row.split(","						)] for row in data.strip().splitlines()]
       __UpperCAmelCase  :				Any       				=		[[0 for cell in row] for row in grid]
       __UpperCAmelCase  :				List[str]       				=		len(grid[0]						)

       __UpperCAmelCase  :				Any       				=		[[0 for i in range(lowerCamelCase__						)] for j in range(lowerCamelCase__						)]
       __UpperCAmelCase  :				str       				=		grid[0][0]
       for i in range(1							,    lowerCamelCase__						):
              __UpperCAmelCase  :				int       				=		grid[0][i] + dp[0][i - 1]
       for i in range(1							,    lowerCamelCase__						):
              __UpperCAmelCase  :				Optional[Any]       				=		grid[i][0] + dp[i - 1][0]

       for i in range(1							,    lowerCamelCase__						):
              for j in range(1							,    lowerCamelCase__						):
                     __UpperCAmelCase  :				Any       				=		grid[i][j] + min(dp[i - 1][j]							,    dp[i][j - 1]						)

       return dp[-1][-1]


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







'''simple docstring'''




def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__						)					->       bool:





       """simple docstring"""


       return not any(
           neighbour == 1 and colored_vertices[i] == color
           for i, neighbour in enumerate(lowerCamelCase__						)						)

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__						)					->       bool:





       """simple docstring"""


       if index == len(lowerCamelCase__						):
              return True

       # Recursive Step
       for i in range(lowerCamelCase__						):
              if valid_coloring(graph[index]							,    lowerCamelCase__							,    lowerCamelCase__						):
                     # Color current vertex
                     __UpperCAmelCase  :				List[str]       				=		i
                     # Validate coloring
                     if util_color(lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__							,    index + 1						):
                            return True
                     # Backtrack
                     __UpperCAmelCase  :				Any       				=		-1
       return False


def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       list[int]:





       """simple docstring"""


       __UpperCAmelCase  :				Optional[Any]       				=		[-1] * len(lowerCamelCase__						)

       if util_color(lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__							,    0						):
              return colored_vertices

       return []






