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