N = int(input())

dic = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

old = ["a"]
new = []
for i in range(1, N):
    print(old)
    for word in old:
        for j in range(i+1):
            if word[-1] == dic[j] or word[-1] == dic[j-1]:
                new.append(word+dic[j])
    old = new.copy()
    new = []
for i in old:
    print(i)
