n = int(eval(input()))





from itertools import product

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'



def dfs(ans, i):

    if len(ans) == n:

        print(("".join(ans)))

        return

    for j in range(i+1):

        dfs(ans+ascii_lowercase[j], max(j+1, i))



dfs("", 0)
n = int(eval(input()))



ansl = []

def dfs(s, max_s):

    if len(s) == n:

        ansl.append(s)

        return

    ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'

    for i in range(max_s+1):

        dfs(s+ascii_lowercase[i], max(i+1, max_s))



dfs("", 0)

for a in ansl:

    print(a)
n = int(eval(input()))
from itertools import product

ascii_lowercase = "abcdefghijklmnopqrstuvwxyz"


def dfs(ans, i):
    if len(ans) == n:
        print(("".join(ans)))
        return
    for j in range(i + 1):
        dfs(ans + ascii_lowercase[j], max(j + 1, i))


dfs("", 0)

n = int(eval(input()))
ansl = []


def dfs(s, max_s):
    if len(s) == n:
        ansl.append(s)
        return
    ascii_lowercase = "abcdefghijklmnopqrstuvwxyz"
    for i in range(max_s + 1):
        dfs(s + ascii_lowercase[i], max(i + 1, max_s))


dfs("", 0)
for a in ansl:
    print(a)

-from itertools import product - -ascii_lowercase = "abcdefghijklmnopqrstuvwxyz" +ansl = [] -def dfs(ans, i): -    if len(ans) == n: -        print(("".join(ans))) +def dfs(s, max_s): +    if len(s) == n: +        ansl.append(s) -    for j in range(i + 1): -        dfs(ans + ascii_lowercase[j], max(j + 1, i)) +    ascii_lowercase = "abcdefghijklmnopqrstuvwxyz" +    for i in range(max_s + 1): +        dfs(s + ascii_lowercase[i], max(i + 1, max_s)) +for a in ansl: +    print(a)