from collections import *



def dfs(now):

    if len(now)==N:

        print((''.join(now)))

        return



    for i in range(ord(max(now))-ord('a')+2):

        now.append(alpha[i])

        dfs(now)

        now.pop()



N = int(eval(input()))

alpha = 'abcdefghijklmnopqrstuvwxyz'

dfs(deque(['a']))
from collections import *



def dfs(l):

    if len(l)==N:

        print((''.join(l)))

        return

    

    for a in range(ord('a'), ord(max(l))+2):

        l.append(chr(a))

        dfs(l)

        l.pop()

    

N = int(eval(input()))

dfs(deque(['a']))
from collections import *


def dfs(now):
    if len(now) == N:
        print(("".join(now)))
        return
    for i in range(ord(max(now)) - ord("a") + 2):
        now.append(alpha[i])
        dfs(now)
        now.pop()


N = int(eval(input()))
alpha = "abcdefghijklmnopqrstuvwxyz"
dfs(deque(["a"]))

from collections import *


def dfs(l):
    if len(l) == N:
        print(("".join(l)))
        return
    for a in range(ord("a"), ord(max(l)) + 2):
        l.append(chr(a))
        dfs(l)
        l.pop()


N = int(eval(input()))
dfs(deque(["a"]))

-def dfs(now): -    if len(now) == N: -        print(("".join(now))) +def dfs(l): +    if len(l) == N: +        print(("".join(l))) -    for i in range(ord(max(now)) - ord("a") + 2): -        now.append(alpha[i]) -        dfs(now) -        now.pop() +    for a in range(ord("a"), ord(max(l)) + 2): +        l.append(chr(a)) +        dfs(l) +        l.pop() -alpha = "abcdefghijklmnopqrstuvwxyz"