var n:integer;
mtr: array [0..100,0..100] of word;
i,j,x,y:byte;
m,c:word;
f:text;
begin
  assign(f,'F.in');
  reset(f);
  read(f,n);
  close(f);

  if n<>1 then
  begin
    c:=n div 2+1;
    mtr[c,c]:=1;
    mtr[c+1,c]:=2;
    mtr[c+1,c-1]:=3;
    m:=3;
    x:=c+1;
    y:=c-1;
    for i:=1 to c-1 do
    begin
      for j:=1 to i*2 do
      begin
        dec(x);
        inc(m);
        mtr[x,y]:=m;
      end;
      for j:=1 to i*2 do
      begin
        inc(y);
        inc(m);
        mtr[x,y]:=m;
      end;
      for j:=1 to i*2+1 do
      begin
        inc(x);
        inc(m);
        mtr[x,y]:=m;
      end;
      for j:=1 to i*2+1 do
      begin
        dec(y);
        inc(m);
        mtr[x,y]:=m;
      end;
    end;

    assign(f,'F.out');
    rewrite(f);
    for y:=1 to n do
    begin
      for x:=1 to n do
        write(f,mtr[x,y],' ');
      writeln(f);
    end;
    close(f);
  end
  else
  begin
    assign(f,'F.out');
    rewrite(f);
    write(f,1);
    close(f);
  end
end.
