l = [[0]*i for i in range(1, 31)] for i in range(30): for j in range(i+1): if j == 0 or i == j: l[i][j] = 1 else: l[i][j] = l[i-1][j-1] + l[i-1][j] n = int(input()) for i in range(n): for j in range(i+1): print('{:>5d}'.format(l[i][j]), end='') print()