def search(s):
    global ans_li
    if len(s) > max_length:
        ans_li.append(s)
    else:
        temp = s+"a"
        search(temp)
        temp = s+"b"
        search(temp)

global ans_li
ans_li = []
n = int(input())
max_length = n-1

search("a")
ans_li.sort()
for i in ans_li:
    print(i)
