#!/bin/python

import sys
from collections import defaultdict


def findPath(i, j, n):
    b = defaultdict(lambda: (-1,-1))
    posQueue = [(0, 0)]
    v = [(i, j), (-i, j), (i, -j), (-i, -j), (j, i), (j, -i), (-j, i), (-j, -i)]
    while len(posQueue) > 0:
        curr = posQueue.pop(0)
        for e in v:
            x = e[0] + curr[0]
            y = e[1] + curr[1]
            if -1 < x < n and -1 < y < n and b[x, y] == (-1,-1):
                b[x, y] = curr
                posQueue.append((x, y))
                if x == n - 1 and y == n - 1:
                    count=1
                    while b[x,y]!=(0,0):
                        count+=1
                        x,y=b[x,y]
                    return count

    return -1


n = int(raw_input().strip())
# your code goes here
a = defaultdict(lambda: -1)
for i in range(1, n):
    for j in range(1, i):
        if a[i, j] == -1:
            a[i, j] = findPath(i, j, n)
            a[j, i] = a[i, j]
    if (n - 1) % i == 0:
        a[i, i] = (n - 1) / i

for i in range(1, n):
    for j in range(1, n - 1):
        print a[i, j],
    print a[i, n - 1]