n = 16

for i in range(n):
    print(i)
    for j in range(n):
        print(i^j, end=' ')
    print()
n = 16

for i in range(n):
    print(i)
    for j in range(n):
        print(i^j, end=' ')
    print()