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

def get_right(S):
    alpha_idx = 0
    for i in range(len(S)):
        idx = S.find(alpha[i])
        if idx > 0:
            alpha_idx = idx
    return alpha_idx + 2


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

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

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