const n=12; m=10;
var a : array[1..n,1..m] of integer;
i,j,k : integer;
begin
k:=0;
for j:=m div 2 downto 1 do
begin
for i:=n downto 1 do begin k:=k+1; a[i,2*j]:=k; end;
for i:=1 to n do begin k:=k+1; a[i,2*j-1]:=k; end;;
end;
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j]:4);
writeln;
end;
end.