import itertools
n = int(input())
l = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
ans = []
for i in list(itertools.product(range(n), repeat=n)):
    d = [1]*n
    d[0] = 0
    flag = True
    if i[0] != 0: flag = False
    for j in range(1, n):
        if i[j-1] == i[j]-1:
            d[i[j]] = 0
        elif d[i[j]]:
            flag = False
    if flag: ans.append(i)
for i in ans:
    s = ""
    for j in i:
        s += l[j]
    print(s)