I,R,P=input,range,print N,M=map(int,I().split()) S=[int(I(),2)for m in R(M)] p=1<