label m ;
var  a:array[1..100,1..100]of longint;
     n,q,w,i,j,k,l:longint;
begin
assign( input , 'F.in' );
 reset( input );
assign( output , 'F.out' );
 rewrite( output );

read(n);
k:=sqr(n)+1;
w:=1;
q:=n;
j:=1;
for l := 1 to n do
begin
for i := w to q do
begin
  dec(k);
  if k=0 then goto m;
  a[i,j]:=k;
end;
inc(w);
for j := w to i do
begin
   dec(k);
   if k=0 then goto m;
   a[i,j]:=k
end;
for i := j-1 downto w-1 do
begin
  dec(k);
  if k=0 then goto m;
  a[i,j]:=k;
end;

for j := q-1 downto w do
begin
  dec(k);
  if k=0 then goto m;
  a[i,j]:=k;
end;
dec(q);
end;
m:for j :=  n downto  1 do
begin
for i := n downto 1 do
write(a[i,j],' ');
writeln;
end;
close( output );
end.