def f(num,N,S):

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

    if N == num:

        for i in S:

          print(i)

        return

    else:

        tmp = []

        length = len(S)

        for i in S:

            ttmp = sorted(list(i))

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

                tmp.append(i+alphabet[j])

        f(num+1,N,tmp)

 

N = int(eval(input()))

f(1,N,["a"])
def saiki(n,A):



    if n == N:

        A.sort()

        for i in A:

            print(i)

        return



    alpha = list("abcdefghijklmnopqr")



    tmp = []



    for i in A:

        a = alpha.index(sorted(list(i))[-1])

        for j in range(a+2):

            tmp.append(i+alpha[j])

    

    saiki(n+1,tmp)



N = int(eval(input()))



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


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

def saiki(n, A):
    if n == N:
        A.sort()
        for i in A:
            print(i)
        return
    alpha = list("abcdefghijklmnopqr")
    tmp = []
    for i in A:
        a = alpha.index(sorted(list(i))[-1])
        for j in range(a + 2):
            tmp.append(i + alpha[j])
    saiki(n + 1, tmp)


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

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