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(q):

    if len(q)==N:

        print((''.join(q)))

        return 

    

    M = 'a'

    

    for qi in q:

        M = max(M, qi)

        

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

        q.append(alpha[i])

        dfs(q)

        q.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(q):
    if len(q) == N:
        print(("".join(q)))
        return
    M = "a"
    for qi in q:
        M = max(M, qi)
    for i in range(ord(M) - ord("a") + 2):
        q.append(alpha[i])
        dfs(q)
        q.pop()


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

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