var di,dj,n,i,buf,j:integer;
   a:array[0..101,0..101] of integer;

begin
    assign(input,'F.in');
    reset(input);
    assign(output,'F.out');
    rewrite(output);
    read(n);
    if n mod 2 <> 0 then begin
    fillchar(a,sizeof(a),0);
    for i:=0 to n+1 do begin
       a[i,0]:=1;
       a[i,n+1]:=1;
       a[0,i]:=1;
       a[n+1,i]:=1 end;

    di:=0;
    dj:=-1;
    buf:=n*n;
    i:=n; j:=n;
    while buf>=1 do begin
        a[i,j]:=buf;
        if a[i+di,j+dj]<>0 then begin
           di:=-1; dj:=0 end;
        if a[i+di,j+dj]<>0 then begin
           di:=0; dj:=1 end;
        if a[i+di,j+dj]<>0 then begin
           di:=1; dj:=0 end;
        if a[i+di,j+dj]<>0 then begin
           di:=0; dj:=-1 end;
        i:=i+di;
        j:=j+dj;
        dec(buf)   end;

    for i:=1 to n do begin
        for j:=1 to n do write(a[i,j],' ');
        writeln;
        end;
        end else write('ERROR');

    close(output);
end.
