def search(s):
    if len(s) > max_length:
        print(s)
    else:
        temp = s+"a"
        search(temp)
        temp = s+"b"
        search(temp)

n = int(input())
max_length = n-1

search("a")