import random
random.seed(12333)
n=int(raw_input())
s=[]
for a in range(1,n+1)[::-1]:
    for b in xrange(a+1,n+1):
        s.append((a,b))
#random.shuffle(s)
g={}
u=0
cn=0
for t in xrange(0,len(s)):
    if s[t][0]==1 or s[t][1]==1:
        u=(10**11)
        x=s[t][0]+s[t][1]-1
        for p in xrange(1,n+1):
            if (x,p) in g:
                u-=g[(x,p)]
    else:
        u=1<<cn
        cn+=1
    g[s[t]]=u
    g[(s[t][1],s[t][0])]=u
for a in xrange(1,n+1):
    s=''
    for b in xrange(1,n+1):
        if a==b:
            s=s+'0 '
        else:
            s=s+str(g[(a,b)])+' '
    print s