const   filein='F.in';
        fileout='F.out';

var i,j,k,l,m,n,one,cur       :longint;
    a                         :array[1..200,1..200] of integer;

procedure readf;
begin
 assign(input,filein);
 reset(input);
  read(n);
 close(input);
end;

procedure main;
begin
 a[n div 2 +1,n div 2 +1]:=1;
 a[n div 2 +1,n div 2 +2]:=2;

 for i:=1 to n div 2 do begin
  cur:=((n+1)-(i*2))*((n+1)-(i*2))+1;
  a[i,i]:=cur;
  for j:=i+1 to n-i+1 do
   a[i,j]:=cur-j+i;
  for j:=i+1 to n-i+1 do
   a[j,i]:=cur+j-i;
 end;

 for i:=1 to (n div 2) -1 do begin
  cur:=(i*2+1)*(i*2+1)+1;
  a[n div 2 +1+i,n div 2 +2+i]:=cur;
  for j:=1 to i*2 do
   a[n div 2-j+i+1,n div 2 +2+i]:=cur+j;
  for j:=1 to i*2 do
   a[n div 2 +1+i,n div 2-j+i+2]:=cur-j;
 end;
 cur:=n*n;
 for i:=n downto 2 do begin
  a[n,i]:=cur-n+i;
 end;
end;

procedure vivod;
begin
 assign(output,fileout);
 rewrite(output);
  for i:=1 to n do begin
   for j:=1 to n do
    write(a[i,j],' ');
   writeln;
  end; 
 close(output);
end;

begin
 readf;
 main;
 vivod;
end. 
