N = int(eval(input()))



answer = [(97, 'a')]

for _ in range(N - 1):

    new_answer = []

    for i, j in answer:

        for k in range(97, i + 2):

            new_answer.append((max(k, i), j + chr(k)))

    answer = new_answer[:]



answer = [j for _, j in answer]

answer.sort()

print(('\n'.join(answer)))

N = int(eval(input()))



answer = [(97, 'a')]

for _ in range(N - 1):

    new_answer = []

    for i, j in answer:

        for k in range(97, i + 1):

            new_answer.append((i, j + chr(k)))

        new_answer.append((i+1,j+chr(i+1)))

    answer = new_answer[:]



answer = [j for _, j in answer]

answer.sort()

print(('\n'.join(answer)))

N = int(eval(input()))
answer = [(97, "a")]
for _ in range(N - 1):
    new_answer = []
    for i, j in answer:
        for k in range(97, i + 2):
            new_answer.append((max(k, i), j + chr(k)))
    answer = new_answer[:]
answer = [j for _, j in answer]
answer.sort()
print(("\n".join(answer)))

N = int(eval(input()))
answer = [(97, "a")]
for _ in range(N - 1):
    new_answer = []
    for i, j in answer:
        for k in range(97, i + 1):
            new_answer.append((i, j + chr(k)))
        new_answer.append((i + 1, j + chr(i + 1)))
    answer = new_answer[:]
answer = [j for _, j in answer]
answer.sort()
print(("\n".join(answer)))

-        for k in range(97, i + 2): -            new_answer.append((max(k, i), j + chr(k))) +        for k in range(97, i + 1): +            new_answer.append((i, j + chr(k))) +        new_answer.append((i + 1, j + chr(i + 1)))