import sys

sys.setrecursionlimit(10**8)

alpha = "abcdefghij"

ans = []

N = int(eval(input()))



def get_right(S):

    alpha_idx = 0

    for i in range(len(S)):

        flag = S.find(alpha[i])

        if flag > 0:

            alpha_idx = i

    return alpha_idx + 2





def dfs(S, num):

    if len(S) == N:

        ans.append(S)

    else:

        right = num + 2

        seq = alpha[:right]

        for i, c in enumerate(seq):

            dfs(S+c, max(i, num))



dfs("a", 0)

ans = sorted(ans)

for a in ans:

    print(a)
import sys

sys.setrecursionlimit(10**8)

alpha = "abcdefghij"

ans = []

N = int(eval(input()))



def dfs(S, num):

    if len(S) == N:

        ans.append(S)

    else:

        right = num + 2

        seq = alpha[:right]

        for i, c in enumerate(seq):

            dfs(S+c, max(i, num))



dfs("a", 0)

ans = sorted(ans)

for a in ans:

    print(a)
import sys

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


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


def dfs(S, num):
    if len(S) == N:
        ans.append(S)
    else:
        right = num + 2
        seq = alpha[:right]
        for i, c in enumerate(seq):
            dfs(S + c, max(i, num))


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

import sys

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


def dfs(S, num):
    if len(S) == N:
        ans.append(S)
    else:
        right = num + 2
        seq = alpha[:right]
        for i, c in enumerate(seq):
            dfs(S + c, max(i, num))


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

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