N = int(input()) for i in range(N): f = (2 * i + 1) % N if f == 0:f += N for _ in range(N): print(f,end = " ") f = (f-1) % N if f == 0:f += N print()