from copy import deepcopy

def f(num,N,S):

    alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"]

    if N == num:

        S.sort()

        for i in range(len(S)):

            print((S[i]))

        return

    else:

        tmp = []

        length = len(S)

        for i in range(length):

            ttmp = list(S[i])

            ttmp.sort()

            tttmp = alphabet.index(ttmp[-1])

            for j in range(tttmp+2):

                tmp.append(S[i]+alphabet[j])

                    

        S = deepcopy(tmp)

        S.sort()

        f(num+1,N,S)



N = int(eval(input()))

f(1,N,["a"])
from copy import deepcopy

def f(num,N,S):

    alphabet = ["a","b","c","d","e","f","g","h","i","j"]

    if N == num:

        for i in range(len(S)):

            print((S[i]))

        return

    else:

        tmp = []

        length = len(S)

        for i in range(length):

            ttmp = sorted(list(S[i]))

            for j in range(alphabet.index(ttmp[-1])+2):

                tmp.append(S[i]+alphabet[j])

        S = sorted(tmp)

        f(num+1,N,S)



N = int(eval(input()))

f(1,N,["a"])
from copy import deepcopy


def f(num, N, S):
    alphabet = [
        "a",
        "b",
        "c",
        "d",
        "e",
        "f",
        "g",
        "h",
        "i",
        "j",
        "k",
        "l",
        "m",
        "n",
        "o",
        "p",
        "q",
        "r",
        "s",
        "t",
    ]
    if N == num:
        S.sort()
        for i in range(len(S)):
            print((S[i]))
        return
    else:
        tmp = []
        length = len(S)
        for i in range(length):
            ttmp = list(S[i])
            ttmp.sort()
            tttmp = alphabet.index(ttmp[-1])
            for j in range(tttmp + 2):
                tmp.append(S[i] + alphabet[j])
        S = deepcopy(tmp)
        S.sort()
        f(num + 1, N, S)


N = int(eval(input()))
f(1, N, ["a"])

from copy import deepcopy


def f(num, N, S):
    alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
    if N == num:
        for i in range(len(S)):
            print((S[i]))
        return
    else:
        tmp = []
        length = len(S)
        for i in range(length):
            ttmp = sorted(list(S[i]))
            for j in range(alphabet.index(ttmp[-1]) + 2):
                tmp.append(S[i] + alphabet[j])
        S = sorted(tmp)
        f(num + 1, N, S)


N = int(eval(input()))
f(1, N, ["a"])

-    alphabet = [ -        "a", -        "b", -        "c", -        "d", -        "e", -        "f", -        "g", -        "h", -        "i", -        "j", -        "k", -        "l", -        "m", -        "n", -        "o", -        "p", -        "q", -        "r", -        "s", -        "t", -    ] +    alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] -        S.sort() -            ttmp = list(S[i]) -            ttmp.sort() -            tttmp = alphabet.index(ttmp[-1]) -            for j in range(tttmp + 2): +            ttmp = sorted(list(S[i])) +            for j in range(alphabet.index(ttmp[-1]) + 2): -        S = deepcopy(tmp) -        S.sort() +        S = sorted(tmp)