N = int(input()) for i in range(N): print(*[((2 * i - j + N) % N + 1) for j in range(N)])