program ass;
var
i,j:integer;
n:=readinteger('n is:');
begin
for i:=1 to 2*n do
for j:=1 to 2*n do
begin
if j<>2*n then
begin
if (n >= j) and (n >= i) then
write('1 ');
if (n >= j) and (n < i) then
write('3 ');
if (n < j) and (n >= i) then
write('2 ');
if (n < j) and (n < i) then
write('4 ');
end
else
begin
if (n < j) and (n >= i) then
writeln('2');
if (n < j) and (n < i) then
writeln('4');
end;
end;
end.