from collections import deque
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n=II()
    mxs=[1]*(n-1)
    mxs[0]=2
    #print(mxs)

    en=n*(n-1)//2
    cc=[1]*en
    for i in range(1,en):
        cc[i]=max(mxs)
        #print(mxs)
        #print(cc)
        for j in range(n-1):
            if i-1-j>=0:mxs[j]+=cc[i]-cc[i-1-j]
            else:mxs[j]+=cc[i]
        if 1<=i:
            for j in range(i+1,n-1):
                mxs[j]-=cc[i]
    ans=[[0]*n for _ in range(n)]
    ci=0
    for i in range(n):
        for j in range(i):
            ans[i][j]=ans[j][i]=cc[ci]
            ci+=1
    for row in ans:print(*row)

main()