input = raw_input

alphas = "abcdefghijklmnopqrs"

n = int(input())

if n == 1:
    print("a")
elif n == 2:
    for out in ["aa", "ab"]:
        print(out)

elif n >= 3:
    former_prefixs = ["aa", "ab"]
    next_i = 3
    while True:
        cur_prefixs = []
        for prefix in former_prefixs:
            prefix_nc = len(set(prefix))
            for c in alphas[:prefix_nc+1]:
                out = prefix + c
                if next_i == n:
                    print(out)
                cur_prefixs.append(out)

        if next_i == n:
            break
        next_i += 1
        former_prefixs = cur_prefixs