# D

N = int(eval(input()))



al = [chr(ord('a') + i) for i in range(26)]



def dfs(S, i):

    if len(S) == N:

        yield ''.join(S)

        return

    for j in range(i):

        for w in dfs(S + [al[j]], i):

            yield w

    for w in dfs(S + [al[i]], i + 1):

        yield w



for w in dfs([], 0):

    print(w)
# D

N = int(eval(input()))



al = [chr(ord('a') + i) for i in range(26)]



def dfs(S, i):

    if len(S) == N:

        yield S

        return

    for j in range(i):

        for w in dfs(S + al[j], i):

            yield w

    for w in dfs(S + al[i], i + 1):

        yield w



for w in dfs('', 0):

    print(w)
# D
N = int(eval(input()))
al = [chr(ord("a") + i) for i in range(26)]


def dfs(S, i):
    if len(S) == N:
        yield "".join(S)
        return
    for j in range(i):
        for w in dfs(S + [al[j]], i):
            yield w
    for w in dfs(S + [al[i]], i + 1):
        yield w


for w in dfs([], 0):
    print(w)

# D
N = int(eval(input()))
al = [chr(ord("a") + i) for i in range(26)]


def dfs(S, i):
    if len(S) == N:
        yield S
        return
    for j in range(i):
        for w in dfs(S + al[j], i):
            yield w
    for w in dfs(S + al[i], i + 1):
        yield w


for w in dfs("", 0):
    print(w)

-        yield "".join(S) +        yield S -        for w in dfs(S + [al[j]], i): +        for w in dfs(S + al[j], i): -    for w in dfs(S + [al[i]], i + 1): +    for w in dfs(S + al[i], i + 1): -for w in dfs([], 0): +for w in dfs("", 0):