# DFS m,n=list(map(int,input().strip().split())) g=[list(map(int,input().strip().split())) for _ in range(m)] def dfs(x,y,z): if (x,y)==(m-1,n-1): for i in z:print(f'({i[0]},{i[1]})') if x+1<m and g[x+1][y]!=1 and (x+1,y) not in z: ...