import random
n=int(raw_input())
s=[]
for a in xrange(1,n+1):
    for b in xrange(a+1,n+1):
        s.append((a,b))
random.shuffle(s)
g={}
for t in xrange(0,len(s)):
    g[s[t]]=t
    g[(s[t][1],s[t][0])]=t
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(2**g[(a,b)]%99999999977)+' '
    print s