N,M=map(int,input().split()) S=[list(map(int,input().split())) for n in range(N)] dp=[0]*(1<=len(idx): dp[bit|1<