var a:array[1..100,1..100]of longint;
    q,w,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;
   q:=1; w:=n;
   repeat
     for i:=w downto q do begin
       a[w,i]:=m-k;
       inc(k);
     end;
     if q=w then break;
     for i:=w-1 downto q+1 do begin
       a[i,q]:=m-k;
       inc(k);
     end;
     for i:=q to w do begin
       a[q,i]:=m-k;
       inc(k);
     end;
     for i:=q+1 to w-1 do begin
       a[i,w]:=m-k;
       inc(k);
     end;              
     inc(q); dec(w);
   until k>m;

   for i:=1 to n do 
    for j:=1 to n do
     if j<n then write(a[i,j],' ') else writeln(a[i,j]);         
  close(output);
end.