import sys n,m = list(map(int, input().split())) maze = [0 for j in range(n)] for i in range(n): row = list(map(int, input().split())) maze[i] = row # initial steps pre = [0,0] if maze[1][0] == 0: cur = [1,0] else: cur = [0,1] # record path history = [] history.append(pre) history.append(cur) # to s...