Program Sequrnce_N; Var n,s,j:integer; legacy:text; begin assign(legacy ,'legacy.in') reset(legacy); resdln(n); close(legacy); assign(legacy,'legacy.out') for i:= 1 to n do begin j:=i; write(j); while j<= n*n do begin if j mod n*o then inc (j); else inc (j,n+1); if j<= n*n then write (' ',j); end; writeln end; close (legacy.out) end.