var
i,j,n,center:longint;
ln, kol,lx,ly  :longint;

 a:array[1..101,1..101]of longint;



begin
assign(input,'f.in');reset(input);
assign(output,'f.out');rewrite(output);
read(n);
center:=(n div 2)+1;
lx :=center;
ly:=center;
a[lx,ly]:=1;
kol:=0;
ln:=1;
While (a[n,n]<>n*n) do
 begin
 inc(kol);
{ //R}
   inc(ln);
   a[lx,ly+1]:=ln;
   inc(ly);
{ //IP}
   for i:=lx-1 downto center-kol do
     begin
       inc(ln);
       a[i,ly]:=ln;
     end;
     lx:=center-kol;
{ //left}
   for i:=ly-1 downto center-kol do
     begin
      inc(ln);
      a[lx,i]:=ln;
     end;
     ly:=center-kol;
{ //down  }
   for i:=lx+1 to center+kol do
     begin
      inc(ln);
      a[i,ly]:=ln;
     end;
     lx:=center+kol;
 {//right}
   for i:=ly+1 to center+kol do
     begin
       inc(ln);
       a[lx,i]:=ln;
     end;
      ly:=center+kol;
 end;

For i:=1 to n do
 begin
for j:=1 to n do
  Write(a[i,j],' ');
  writeln;

 end;





close(input);
close(output);
end.