N = int(eval(input()))

al = "abcdefghijklmnopqrstuvwxyz"

atoi = {s:i for i, s in enumerate(al)}

itoa = {i:s for i, s in enumerate(al)}



l = []

def func(s, i):

    if i == N:

        print(s)

        l.append(s)

        return

    # if al[:i] == s:

    #     for c in al[:i+1]:

    #         func(s + c, i+1)

    # else:

    #     for c in al:

    #         func(s + c, i+1 )



    # if i == N - 1:

    maxi = max([atoi[c] for c in s])

    for c in al[:maxi+2]:

        func(s+c, i+1)

    # else:

    #     for c in al[:i+1]:

    #         func(s+c, i+1) 



func("a", 1)



N = int(eval(input()))

al = "abcdefghijklmnopqrstuvwxyz"

atoi = {s:i for i, s in enumerate(al)}



def func(s, i):

    if i == N:

        print(s)

        return



    maxi = max([atoi[c] for c in s])

    for c in al[:maxi+2]:

        func(s+c, i+1)



func("a", 1)



N = int(eval(input()))
al = "abcdefghijklmnopqrstuvwxyz"
atoi = {s: i for i, s in enumerate(al)}
itoa = {i: s for i, s in enumerate(al)}
l = []


def func(s, i):
    if i == N:
        print(s)
        l.append(s)
        return
    # if al[:i] == s:
    #     for c in al[:i+1]:
    #         func(s + c, i+1)
    # else:
    #     for c in al:
    #         func(s + c, i+1 )
    # if i == N - 1:
    maxi = max([atoi[c] for c in s])
    for c in al[: maxi + 2]:
        func(s + c, i + 1)
    # else:
    #     for c in al[:i+1]:
    #         func(s+c, i+1)


func("a", 1)

N = int(eval(input()))
al = "abcdefghijklmnopqrstuvwxyz"
atoi = {s: i for i, s in enumerate(al)}


def func(s, i):
    if i == N:
        print(s)
        return
    maxi = max([atoi[c] for c in s])
    for c in al[: maxi + 2]:
        func(s + c, i + 1)


func("a", 1)

-itoa = {i: s for i, s in enumerate(al)} -l = [] -        l.append(s) -    # if al[:i] == s: -    #     for c in al[:i+1]: -    #         func(s + c, i+1) -    # else: -    #     for c in al: -    #         func(s + c, i+1 ) -    # if i == N - 1: -    # else: -    #     for c in al[:i+1]: -    #         func(s+c, i+1)