n = int(eval(input()))

candidate = ['a']





def dfs(s, c):

    if len(s) == n:

        return

    for i in range(ord('a'), ord(c) + 2):

        now = s + chr(i)

        candidate.append(now)

        if i > ord(c):

            dfs(now, chr(i))

        else:

            dfs(now, c)





dfs('a', 'a')



for c in candidate:

    if len(c) == n:

        print(c)

n = int(eval(input()))



if n == 1:

    print('a')

    exit()



ans = []





def dfs(s, c):

    for i in range(ord('a'), ord(c) + 2):

        now = s + chr(i)

        if len(now) == n:

            ans.append(now)

        elif i > ord(c):

            dfs(now, chr(i))

        else:

            dfs(now, c)





dfs('a', 'a')



for c in ans:

    print(c)

n = int(eval(input()))
candidate = ["a"]


def dfs(s, c):
    if len(s) == n:
        return
    for i in range(ord("a"), ord(c) + 2):
        now = s + chr(i)
        candidate.append(now)
        if i > ord(c):
            dfs(now, chr(i))
        else:
            dfs(now, c)


dfs("a", "a")
for c in candidate:
    if len(c) == n:
        print(c)

n = int(eval(input()))
if n == 1:
    print("a")
    exit()
ans = []


def dfs(s, c):
    for i in range(ord("a"), ord(c) + 2):
        now = s + chr(i)
        if len(now) == n:
            ans.append(now)
        elif i > ord(c):
            dfs(now, chr(i))
        else:
            dfs(now, c)


dfs("a", "a")
for c in ans:
    print(c)

-candidate = ["a"] +if n == 1: +    print("a") +    exit() +ans = [] -    if len(s) == n: -        return -        candidate.append(now) -        if i > ord(c): +        if len(now) == n: +            ans.append(now) +        elif i > ord(c): -for c in candidate: -    if len(c) == n: -        print(c) +for c in ans: +    print(c)