import sys

import copy

input = sys.stdin.readline



N = int(eval(input()))



if N == 1:

    print('a')

    exit()

if N == 2:

    print('aa')

    print('ab')

    exit()



ans = ['aaa', 'aab', 'aba', 'abb', 'abc']

alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

length = 3



while length < N:

    ans2 = []

    for value in ans:

        for letter in alph:

            ans2.append(value + letter)

            if letter not in value:

                break

    length += 1

    ans = copy.deepcopy(sorted(ans2))



for value in ans:

    print(value)
import sys

import string

input = sys.stdin.readline



N = int(eval(input()))



ans = ['a']

alph = list(string.ascii_lowercase[:10])

l = 1



while l < N:

    ans2 = []

    for value in ans:

        for letter in alph:

            ans2.append(value + letter)

            if letter not in value:

                break

    l += 1

    ans = ans2

    

for value in sorted(ans):

    print(value)
import sys
import copy

input = sys.stdin.readline
N = int(eval(input()))
if N == 1:
    print("a")
    exit()
if N == 2:
    print("aa")
    print("ab")
    exit()
ans = ["aaa", "aab", "aba", "abb", "abc"]
alph = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
length = 3
while length < N:
    ans2 = []
    for value in ans:
        for letter in alph:
            ans2.append(value + letter)
            if letter not in value:
                break
    length += 1
    ans = copy.deepcopy(sorted(ans2))
for value in ans:
    print(value)

import sys
import string

input = sys.stdin.readline
N = int(eval(input()))
ans = ["a"]
alph = list(string.ascii_lowercase[:10])
l = 1
while l < N:
    ans2 = []
    for value in ans:
        for letter in alph:
            ans2.append(value + letter)
            if letter not in value:
                break
    l += 1
    ans = ans2
for value in sorted(ans):
    print(value)

-import copy +import string -if N == 1: -    print("a") -    exit() -if N == 2: -    print("aa") -    print("ab") -    exit() -ans = ["aaa", "aab", "aba", "abb", "abc"] -alph = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] -length = 3 -while length < N: +ans = ["a"] +alph = list(string.ascii_lowercase[:10]) +l = 1 +while l < N: -    length += 1 -    ans = copy.deepcopy(sorted(ans2)) -for value in ans: +    l += 1 +    ans = ans2 +for value in sorted(ans):