var a:array[1..100, 1..100] of integer;
n,l,s,z,i,q:longint;
begin
assign(input,'F.in');
reset(input);
assign(output,'F.out');
rewrite(output);
readln(n);
s:=n;
l:=n;
a[l,s]:=n*n;
z:=1;
q:=(n div 2)+1;
while a[q,q]<>1 do
begin
  while s-z<>0 do
      begin
          a[l,s-1]:=a[l,s]-1;
          dec(s);
      end;
  while l-z<>0 do
      begin
          a[l-1,s]:=a[l,s]-1;
          dec(l);
      end;
  while s+z<>n+1 do
      begin
          a[l,s+1]:=a[l,s]-1;
          inc(s);
      end;
  while a[l+1,s]=0 do
      begin
          a[l+1,s]:=a[l,s]-1;
          inc(l);
      end;
  inc(z);
end;
for i:=1 to n do
    begin
        for q:=1 to n do write(a[i,q],' ');
        writeln;
    end;
close(input);
close(output);
end.
