

N = int(eval(input()))



def dfs(x):

    if len(x) == N:

        s = "".join(chr(v + ord("a")) for v in x)

        print(s)

        return



    val = max(x)

    for i in range(val + 2):

        x.append(i)

        dfs(x)

        x.pop()



dfs([0])



N = int(eval(input()))





def func(x):

    if len(x) == N:

        print(("".join(x)))

        return



    last = ord(max(x)) - ord("a") + 1 if x else 0

    for i in range(min(26, last) + 1):

        x.append(chr(ord("a") + i))

        func(x)

        x.pop()





func([])

N = int(eval(input()))


def dfs(x):
    if len(x) == N:
        s = "".join(chr(v + ord("a")) for v in x)
        print(s)
        return
    val = max(x)
    for i in range(val + 2):
        x.append(i)
        dfs(x)
        x.pop()


dfs([0])

N = int(eval(input()))


def func(x):
    if len(x) == N:
        print(("".join(x)))
        return
    last = ord(max(x)) - ord("a") + 1 if x else 0
    for i in range(min(26, last) + 1):
        x.append(chr(ord("a") + i))
        func(x)
        x.pop()


func([])

-def dfs(x): +def func(x): -        s = "".join(chr(v + ord("a")) for v in x) -        print(s) +        print(("".join(x))) -    val = max(x) -    for i in range(val + 2): -        x.append(i) -        dfs(x) +    last = ord(max(x)) - ord("a") + 1 if x else 0 +    for i in range(min(26, last) + 1): +        x.append(chr(ord("a") + i)) +        func(x) -dfs([0]) +func([])