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