import sys
n = int(input())
memo_ls = [{i : [] for i in range(11)} for j in range(11)]
alpha = "abcdefghijklmnopqrstuvwxyz"
#memo_ls[i][j] : i個をjに分ける方法
memo_ls[1][1] = ["a"]
for i in range(1,10):
    for j in range(11):
        if j > i:
            continue
        else:
            for v in memo_ls[i][j]:
                for k in range(j):
                    memo_ls[i + 1][j].append(v + alpha[k])
                memo_ls[i+1][j+1].append(v + alpha[j])
ls = []
for i in range(11):
    for j in memo_ls[n][i]:
        ls.append(j)
print("\n".join(ls))