import string

n = int(input())

Ans = [[] for _ in range(n+1)]
Ans[1].append('a')
Strs = [x for x in string.ascii_lowercase]

for i in range(1,n):
    for ans in Ans[i]:
        Use_str = [x for x in ans]
        Use_str = set(Use_str)
        for moji in Use_str:
            add = ans + moji
            Ans[i+1].append(add)
        add = ans + Strs[len(Use_str)]
        Ans[i+1].append(add)

for ans in Ans[n]:
    print(ans)