import math

N = int(input())
ZL = [[] for _ in range(N)]
ZL[0].append([0])
for i in range(1, N):
    for szl in ZL[i - 1]:
        n1 = szl[-1]
        for j in range(n1 + 2):
            ZL[i].append(szl + [j])


def func(i):
    if i == 0:
        return "a"
    if i == 1:
        return "b"
    if i == 2:
        return "c"
    if i == 3:
        return "d"
    if i == 4:
        return "e"
    if i == 5:
        return "f"
    if i == 6:
        return "g"
    if i == 7:
        return "h"
    if i == 8:
        return "i"
    if i == 9:
        return "j"


L = ZL[N - 1]
for sl in L:
    for i in range(N):
        sl[i] = func(sl[i])

for sl in L:
    print("".join(map(str, sl)))
