var x,y,i,j:word;begin read(y,x);for j:=0to y-1do for i:=1to x do write(1and(i+j),copy(#10#32,2-i div x,1))end.