var   x,y,x1,y1,x2,y2,n,i,j,q:longint;
a:array[1..101,1..101] of longint;

procedure create(x,y:longint);
begin

    for i:=x downto x1 do
    begin
        a[y,i]:=q;
        dec(q);
    end;
    for i:=y2-1 downto y1 do
    begin
         a[i,x1]:=q;
         dec(q);
    end;
    for i:=x1+1 to x2 do
    begin
        a[y1,i]:=q;
        dec(q);
    end;
    for i:=y1+1 to y2-1 do
    begin
        a[i,x2]:=q;
        dec(q);
    end;

end;

begin
     assign(input,'f.in');
     reset(input);
     assign(output,'f.out');
     rewrite(output);
     readln(n);

     x1:=1;
     y1:=1;
     x2:=n;
     y2:=n;
     q:=n*n;
     while (x1<>x2)and(y1<>y2)do
     begin
        create(x2,y2);
        inc(x1);
        inc(y1);
        dec(x2);
        dec(y2);
     end;
     a[(n+1)div 2,(n+1)div 2] :=1;
     for i:=1 to n do
     begin
      for j:=1 to n do
      begin
        write(a[i,j],' ');
      end;writeln;
     end;
    close(input);
    close(output);
end.
