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

def dfs(k, s):
    if n == k:
        ans.append(s)
    elif n > k:
        for i in range(max([d[c] for c in s])+2):
            v = s + a[i]
            dfs(k+1, v)
dfs(1,"a")
ans.sort()
for k in range(len(ans)):
    print(ans[k])
