program f;

{$APPTYPE CONSOLE}

uses
  SysUtils;
     var
     n:integer;
     a:array[1..100,1..100] of integer;
     i,j,k:integer;
begin
 assign(input,'f.in');
 reset(input);
 assign(output,'f.out');
 readln(n);
 a[n div 2+1, n div 2 +1]:=1;
 k:=2;
 for i:=1 to (n div 2) do
 begin
 for j:=((n div 2)+3-i) to ((n div 2)+1+i) do
 begin
 a[n div 2 +i,j]:=k;
 k:=k+1;
 end;

  for j:=((n div 2)+i-1) downto ((n div 2) +1 -i) do
  begin
  a[j,n div 2 +1 +i]:=k;
  k:=k+1;
  end;
                  {3}
 for j:=(n div 2 +i) downto (n div 2 -i+1) do
 begin
  a[ n div 2-i+1,j]:=k;
  k:=k+1;
  end;

  for j:=(n div 2 -i+2) to (n div 2+i+1) do
  begin
  a[j,n div 2-i+1]:=k;
  k:=k+1;
  end;
  end;
  for j:=2 to  n do
  begin
  a[n,j]:=k;
  k:=k+1;
  end;
  for i:=1 to  n do
  begin
  for j:=1 to  n do
  begin
  write(a[i,j],' ');
  end;
  writeln;
  end;
 close(output);
end.
