program zadf;

{$APPTYPE CONSOLE}

var
  a:array[1..100,1..100] of integer;
  n,z,m:integer;
  i,j,r:integer;
  right,up,left,down:integer;
  fl:integer;
begin
  assignfile(input,'input.txt');
  reset(input);
  assignfile(output,'output.txt');
  rewrite(output);
  read(n);
  m:=n;
  fillchar(a,n*n,0);
  z:=(n div 2)+1;
  n:=n*n;
  fl:=1;
  j:=z;
  i:=z;
  right:=z+1;
  up:=z-1;
  left:=z-1;
  down:=z+1;
  a[z,z]:=1;
  for r:=2 to n do
    begin
      case fl of
        1:begin
            j:=j+1;
            a[i,j]:=r;
            if j=right then
              begin
                right:=right+1;
                fl:=2;
              end;
          end;
        2:begin
            i:=i-1;
            a[i,j]:=r;
            if i=up then
              begin
                up:=up-1;
                fl:=3;
              end;
          end;
        3:begin
            j:=j-1;
            a[i,j]:=r;
            if j=left then
              begin
                left:=left-1;
                fl:=4;
              end;
          end;
        4:begin
            i:=i+1;
            a[i,j]:=r;
            if i=down then
              begin
                down:=down+1;
                fl:=1;
              end;
          end;
      end;
    end;
  for i:=1 to m do
    begin
      for j:=1 to m do
        write(a[i,j],' ');
      writeln;
    end;
  closefile(output);

end.
