def dfs(n, i, s):
    global ans
    s += chr(i)
    if n == N:
        ans += [s]
        return
    for ii in range(97, i+2):
        dfs(n+1, ii, s)

N = int(input())
i = 97
ans = []
dfs(1, 97, '')
ans = sorted(ans)
for a in ans:
    print(a)