
import os





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase = "input.txt"							):

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

    snake_case__						=				len(__lowerCAmelCase							)
    snake_case__						=				len(matrix[0]							)

    snake_case__						=				[[-1 for _ in range(__lowerCAmelCase							)] for _ in range(__lowerCAmelCase							)]
    for i in range(__lowerCAmelCase							):
        snake_case__						=				matrix[i][0]

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

        for i in range(1    ,		__lowerCAmelCase							):
            snake_case__						=				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__						=				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() = }''')





# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase							):
    snake_case__						=				[False] * len(__lowerCAmelCase							)
    snake_case__						=				[-1] * len(__lowerCAmelCase							)

    def dfs(__lowerCAmelCase    ,		__lowerCAmelCase							):
        snake_case__						=				True
        snake_case__						=				c
        for u in graph[v]:
            if not visited[u]:
                dfs(__lowerCAmelCase    ,		1 - c							)

    for i in range(len(__lowerCAmelCase							)							):
        if not visited[i]:
            dfs(__lowerCAmelCase    ,		0							)

    for i in range(len(__lowerCAmelCase							)							):
        for j in graph[i]:
            if color[i] == color[j]:
                return False

    return True


# Adjacency list of graph
__magic_name__            =  {0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}





print(check_bipartite_dfs(graph))



