n = int(input())
ans = [[0] * n for _ in [0] * n]

can = []
ban1 = set()
ban2 = set()

k = 1
while len(can) < 9:
    if k in ban1 or any(k + l in ban2 for l in can):
        k += 1
        continue
    ban1.add(k)
    ban2.update(k + l for l in can)
    can.append(k)
    k += 1

m = 1
for i in range(n):
    for j, c in zip(range(i + 1, n), can):
        ans[i][j] = ans[j][i] = m * c
    m = ans[i][-1] + 1

print('\n'.join(' '.join(map(str, row)) for row in ans))
