N = int(input())
field = [[2]*N for _ in range(N)]
for i in range(N-1):
    for j in range(N-1-i):
        field[i][j] = 0
for i in range(N//2):
    field[i][N-1-i] = 1
for line in field:
    print(''.join([f'{n}' for n in line]))