n = int(input())

text = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

if n == 1:
    print("a")
if n == 2:
    print("aa\nab")
else:
    old = []
    old.append(["aa"])
    old.append(["ab"])
    for i in range(2, n):
        result = []
        for j in range(2, i + 2):
            if j == 2:
                tmp = []
                result.append([old[0][0] + 'a'])
                result.append([old[0][0] + 'b'])
            else:
                tmp = []
                for txt in old[j - 2]:
                    for k in range(j):
                        tmp.append(txt + text[k])
                result.append(tmp)
        old = result

    for rows in old:
        for row in rows:
            print(row)
