(define N (read)) (dotimes [i N] (dotimes [j N] (display (+ 1 (remainder (+ i j) N))) (display " ")) (newline))