Var
a:array[1..100,1..100] of longint;
n,m,i,j:longint;
begin
readln(n);
for i:=1 to n do for j:=1 to n do
begin
if not odd(n) and((i=n div 2)or(i=(n div 2)+1)) then a[i,j]:=1 else
if odd(n) and( i=(n div 2)+1) then a[i,j]:=1 else
if iif i>n div 2 then a[i,j]:=2;
end;
for i:=1 to n do
begin
for j:=1 to n do write(a[i,j]);
writeln;
end;
end.