Scanf.scanf "%d" (fun n -> for i = 0 to n - 1 do for j = 0 to n - 1 do Printf.printf "%d " @@ ((i + j) mod n) + 1 done; print_newline () done )