n = int(eval(input()))

A = ['a']

S = 'abcdefghij'

for _ in range(n-1):

    B = []

    for a in A:

        for s in S[:len(set(a)) + 1]:

            B.append(a + s)

    A = B[::]

print(('\n'.join(A)))
n = int(eval(input()))

A = ['a']

S = 'abcdefghij'

for _ in range(n-1):

    A = [ a + s for a in A for s in S[:len(set(a)) + 1]]

print(('\n'.join(A)))
n = int(eval(input()))
A = ["a"]
S = "abcdefghij"
for _ in range(n - 1):
    B = []
    for a in A:
        for s in S[: len(set(a)) + 1]:
            B.append(a + s)
    A = B[::]
print(("\n".join(A)))

n = int(eval(input()))
A = ["a"]
S = "abcdefghij"
for _ in range(n - 1):
    A = [a + s for a in A for s in S[: len(set(a)) + 1]]
print(("\n".join(A)))

-    B = [] -    for a in A: -        for s in S[: len(set(a)) + 1]: -            B.append(a + s) -    A = B[::] +    A = [a + s for a in A for s in S[: len(set(a)) + 1]]