import sys
sys.setrecursionlimit(10**8)
alpha = "abcdefghij"
ans = []
N = int(input())

def dfs(S):
    if len(S) == N:

        ans.append(S)
    else:
        right = alpha.find(S[-1])+2
        seq = alpha[:right]
        for c in seq:
            dfs(S+c)
    return

dfs("a")
ans = sorted(ans)
for a in ans:
    print(a)