from string import ascii_lowercase
n = int(input())
d = {s: i for i, s in enumerate(ascii_lowercase)}
# r = {i: s for i, s in enumerate(ascii_lowercase)}
a = [s for s, i in d.items()]
# print(d['a'])
# print(r)
ans = []

def dfs(k, s):
    if n == k:
        ans.append(s)
    elif n > k:
        # 元の文字+1まで(a:0, b:1, ...)
        # print(max([d[c] for c in s])+1)
        for i in range(max([d[c] for c in s])+2):
            v = s + a[i]
            # print(v)
            dfs(k+1, v)
dfs(1,'a')
# print(ans)
ans.sort()
for k in ans:
    print(k)