import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines n, m=map(int, readline().split()) a=list(map(int, read().split())) x=0 for i, k in enumerate(a): if k: x^=(1<=n or j1<0 or j1>=m: continue v[i*m+j]^=(1<<(i1*m+j1)) basis, idx, w=Gauss_Jordan(v) z=x for b, i in basis: if (z^b)