var d,t,b,l,r,i,j,k,n,m,s,x,y:longint;
a:array[1..105,1..105] of longint;
procedure d1;
begin 
  inc(j);
  inc(r); inc(b);
  dec(l); dec(t);
{  Writeln('right ',r);}
  while (j<r) do
   begin 
    a[i,j]:=k;
    inc(k);
    inc(j);
   end;
  a[i,j]:=k;
  inc(k);
  
end;
procedure d2;
begin 
  dec(i);
{  Writeln('top ',t);}
  while (i>t)  do 
   begin
     a[i,j]:=k;
     inc(k);
     dec(i);
   end;
     a[i,j]:=k;
     inc(k);
     
end;
procedure d3;
begin 
{  Writeln('left ',l);    }
  dec(j);
  while (j>l)  do 
   begin
     a[i,j]:=k;
     inc(k);
     dec(j);
   end;
     a[i,j]:=k;
     inc(k);
     
end;

procedure d0;
begin 
  inc(i);
  {Writeln('bottom ',b);}
  while (i<b)  do 
   begin
     a[i,j]:=k;
     inc(k);
     inc(i);
   end;
     a[i,j]:=k;
     inc(k);
     
end;






begin 
 assign(input,'F.in');reset(input);
 assign(output,'F.out'); rewrite(output);
 read(n);
 if (n=1) then  
  begin 
   write(1);
   close(output);
   halt;
  end;  
 

 m:=(n div 2)+1;
 a[m,m]:=1;
 k:=2;
 i:=m; j:=m;
 t:=m; b:=m;
 l:=m; r:=m; 
 d:=1;

  while (k<=n*n) do 
   begin 
     if (d=1) then d1 else   
     if (d=2) then d2 else
     if (d=3) then d3 else 
      if (d=0) then d0;
    d:=(d+1) mod 4;   
   

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



 close(output);
end.