def Pop_Count(N): r=(N&0x5555555555555555)+((N>>1)&0x5555555555555555) r=(r&0x3333333333333333)+((r>>2)&0x3333333333333333) r=(r&0x0f0f0f0f0f0f0f0f)+((r>>4)&0x0f0f0f0f0f0f0f0f) r=(r&0x00ff00ff00ff00ff)+((r>>8)&0x00ff00ff00ff00ff) r=(r&0x0000ffff0000ffff)+((r>>16)&0x0000ffff0000ffff) r=(r&0x00000000ffffffff)+((r>>32)&0x00000000ffffffff) return r N,M=map(int,input().split()) S=[0]*M for n in range(N): s=list(map(int,input().split())) for m in range(M): S[m]|=s[m]<=dp_pop[bit^1<