n = int(input())

L =  [[[] for i in range(10)] for j in range(10)]
#print(L)
L[0][0].append('a')
#print(L[0])
for i in range(1, n):
    for j in range(10):
        if j == 0:
            t = chr(j + ord('a'))
            for c in L[i-1][j]:
                L[i][j].append(c+t)
        else:
            t = chr(j + ord('a'))
            for c in L[i-1][j-1]:
                L[i][j].append(c+t)
            for c in L[i-1][j]:
                L[i][j].append(c+t)
#print(L)

ans = []
for i in range(10):
    for c in L[n-1][i]:
        ans.append(c)
ans.sort()
for c in ans:
    print(c)
