var tab:array[1..100,1..100] of longint;
    b,g,i,j,k,n,m:longint;
begin
assign(input,'F.in'); reset(input);
assign(output,'F.out'); rewrite(output);
 read(n);
  k:=0; m:=n*n;
b:=1; g:=n;
 repeat
 for i:=g downto b do begin
  tab[g,i]:=m-k;
 inc(k);
end;
 if b=g then break;
for i:=g-1 downto b+1 do begin
tab[i,b]:=m-k;
inc(k);
end;
for i:=b to g do begin
 tab[b,i]:=m-k;
 inc(k);
end;
  for i:=b+1 to g-1 do begin 
tab[i,g]:=m-k;
inc(k);
end;
inc(b); dec(g);
until k>m;
 for i:=1 to n do
  for j:=1 to n do
  if j<n then write(tab[i,j],' ') else writeln(tab[i,j]);
close(output);
end.
 