import sys

import numpy as np

from itertools import combinations





def input():

    return sys.stdin.readline()[:-1]





if __name__ == "__main__":

    N = int(eval(input()))

    al = [chr(ord('a') + i) for i in range(26)]



    def dfs(s, mx):

        if (len(s) == N):

            print(s)

        else:

            for c in al:

                if c == chr(ord(mx) + 1):

                    break

                tmp = chr(ord(mx) + 1) if (c == mx) else mx

                dfs(s+c, tmp)



    dfs('', 'a')

import sys





def input():

    return sys.stdin.readline()[:-1]





if __name__ == "__main__":

    N = int(eval(input()))

    al = [chr(ord('a') + i) for i in range(26)]



    def dfs(s, mx):

        if (len(s) == N):

            print(s)

        else:

            for c in al:

                if c == chr(ord(mx) + 1):

                    break

                nmx = chr(ord(mx) + 1) if (c == mx) else mx  # 次のmx

                dfs(s + c, nmx)



    dfs('', 'a')

import sys
import numpy as np
from itertools import combinations


def input():
    return sys.stdin.readline()[:-1]


if __name__ == "__main__":
    N = int(eval(input()))
    al = [chr(ord("a") + i) for i in range(26)]

    def dfs(s, mx):
        if len(s) == N:
            print(s)
        else:
            for c in al:
                if c == chr(ord(mx) + 1):
                    break
                tmp = chr(ord(mx) + 1) if (c == mx) else mx
                dfs(s + c, tmp)

    dfs("", "a")

import sys


def input():
    return sys.stdin.readline()[:-1]


if __name__ == "__main__":
    N = int(eval(input()))
    al = [chr(ord("a") + i) for i in range(26)]

    def dfs(s, mx):
        if len(s) == N:
            print(s)
        else:
            for c in al:
                if c == chr(ord(mx) + 1):
                    break
                nmx = chr(ord(mx) + 1) if (c == mx) else mx  # 次のmx
                dfs(s + c, nmx)

    dfs("", "a")

-import numpy as np -from itertools import combinations -                tmp = chr(ord(mx) + 1) if (c == mx) else mx -                dfs(s + c, tmp) +                nmx = chr(ord(mx) + 1) if (c == mx) else mx  # 次のmx +                dfs(s + c, nmx)