n = int(eval(input()))



L = [0]*n

for i in range(n):

    L[i] = chr(i+ord('a'))

#print(L)_



ans = []

def dfs(A):

    if len(A) == n:

        ans.append(''.join(A))

        return

    for v in L[0:len(set(A))+1]:

        A.append(v)

        dfs(A)

        A.pop()



dfs([])

ans.sort()

for i in range(len(ans)):

    print((ans[i]))

n = int(eval(input()))



ans = []

def dfs(A):

    if len(A) == n:

        ans.append(''.join(A))

        return

    for i in range(len(set(A))+1):

        v = chr(i+ord('a'))

        A.append(v)

        dfs(A)

        A.pop()



dfs([])

ans.sort()

for i in range(len(ans)):

    print((ans[i]))

n = int(eval(input()))
L = [0] * n
for i in range(n):
    L[i] = chr(i + ord("a"))
# print(L)_
ans = []


def dfs(A):
    if len(A) == n:
        ans.append("".join(A))
        return
    for v in L[0 : len(set(A)) + 1]:
        A.append(v)
        dfs(A)
        A.pop()


dfs([])
ans.sort()
for i in range(len(ans)):
    print((ans[i]))

n = int(eval(input()))
ans = []


def dfs(A):
    if len(A) == n:
        ans.append("".join(A))
        return
    for i in range(len(set(A)) + 1):
        v = chr(i + ord("a"))
        A.append(v)
        dfs(A)
        A.pop()


dfs([])
ans.sort()
for i in range(len(ans)):
    print((ans[i]))

-L = [0] * n -for i in range(n): -    L[i] = chr(i + ord("a")) -# print(L)_ -    for v in L[0 : len(set(A)) + 1]: +    for i in range(len(set(A)) + 1): +        v = chr(i + ord("a"))