n = int(eval(input()))



ans = []

def dfs(x):

    if len(x) == n:

        ans.append(x)

        return

    for i in range(max(x)+1):

        y = x.copy()

        y.append(i+1)

        dfs(y)

dfs([1])

#print(ans)



for ai in ans:

    print((''.join([chr(ord('a') + x - 1) for x in ai])))



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

#for ai in ans:

#    print(''.join(map(lambda x: str(r[x-1]), ai)))





n = int(eval(input()))

ans = []

def dfs(x):

    if len(x) == n:

        print((''.join([chr(ord('a') + i - 1) for i in x])))

        return

    for i in range(max(x)+1):

        y = x.copy()

        y.append(i+1)

        dfs(y)

dfs([1])



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


def dfs(x):
    if len(x) == n:
        ans.append(x)
        return
    for i in range(max(x) + 1):
        y = x.copy()
        y.append(i + 1)
        dfs(y)


dfs([1])
# print(ans)
for ai in ans:
    print(("".join([chr(ord("a") + x - 1) for x in ai])))
# r = ['a','b','c','d','e','f','g','h','i','j']
# for ai in ans:
#    print(''.join(map(lambda x: str(r[x-1]), ai)))

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


def dfs(x):
    if len(x) == n:
        print(("".join([chr(ord("a") + i - 1) for i in x])))
        return
    for i in range(max(x) + 1):
        y = x.copy()
        y.append(i + 1)
        dfs(y)


dfs([1])

-        ans.append(x) +        print(("".join([chr(ord("a") + i - 1) for i in x]))) -# print(ans) -for ai in ans: -    print(("".join([chr(ord("a") + x - 1) for x in ai]))) -# r = ['a','b','c','d','e','f','g','h','i','j'] -# for ai in ans: -#    print(''.join(map(lambda x: str(r[x-1]), ai)))