var
a:array[0..101,0..101] of longint;
x,y,i,j,n:longint;
f1:boolean;
begin
readln(n);
x:=1;y:=(n+1) div 2;
a[x,y]:=1;
for i:=2 to n*n do
begin
f1:=true;
if f1 and (x=1) and (y<>n) then begin x:=n;y:=y+1;f1:=false;end;
if f1 and (y=n) and (x<>1) then begin x:=x-1;y:=1;f1:=false;end;
if f1 and (x=1) and (y=n) then begin x:=x+1;f1:=false;end;
if f1 and (x<>1) and (y<>n) then
begin
if a[x-1,y+1]=0 then begin x:=x-1;y:=y+1;end else
x:=x+1;
end;
a[x,y]:=i;
end;
for i:=1 to n do
begin
for j:=1 to n do
write(a[i,j],' ');
writeln;
end;
end.