DFS m, n = map(int, input().split()) mat = [] x, y = 0, 0 for i in range(m): mat.append(list(map(int, input().split()))) def dfs(x,y,track): if x==m-1 and y ==n-1: for t in track: print(t) for dx, dy in ((0,1),(0,-1),(1,0),(-1,0)): if 0<=dx+x<m and 0<...