n = int(eval(input()))



d = 'abcdefghijklm'





def conv(s):

    s = list([d[x] for x in s])

    return ''.join(s)





def dfs(s):

    if len(s) == n:

        print((conv(s)))

    else:

        mx = max(s)+1

        for i in range(mx+1):

            dfs(s+[i])





dfs([0])
n = int(eval(input()))



d = 'abcdefghijklm'





def conv(s):

    s = list([d[x] for x in s])

    return ''.join(s)





def dfs(s, k):

    if len(s) == n:

        print(s)

    else:

        for i in range(k):

            dfs(s+d[i], k)

        dfs(s+d[k], k+1)





dfs('a', 1)

n = int(eval(input()))
d = "abcdefghijklm"


def conv(s):
    s = list([d[x] for x in s])
    return "".join(s)


def dfs(s):
    if len(s) == n:
        print((conv(s)))
    else:
        mx = max(s) + 1
        for i in range(mx + 1):
            dfs(s + [i])


dfs([0])

n = int(eval(input()))
d = "abcdefghijklm"


def conv(s):
    s = list([d[x] for x in s])
    return "".join(s)


def dfs(s, k):
    if len(s) == n:
        print(s)
    else:
        for i in range(k):
            dfs(s + d[i], k)
        dfs(s + d[k], k + 1)


dfs("a", 1)

-def dfs(s): +def dfs(s, k): -        print((conv(s))) +        print(s) -        mx = max(s) + 1 -        for i in range(mx + 1): -            dfs(s + [i]) +        for i in range(k): +            dfs(s + d[i], k) +        dfs(s + d[k], k + 1) -dfs([0]) +dfs("a", 1)