# ret = []
N = int(input())
L = [[0]]
ret.append(L.copy())

for _ in range(N - 1):
    newL = []
    for s in L:
        for i in range(max(s) + 2):
            newL.append(s.copy() + [i])
#     ret.append(newL.copy())
    L = newL.copy()
    

print('\n'.join([''.join(list(map(lambda x: di[x], newL[i]))) for i in range(len(newL))]))