s = 'a'
n = int(input())
res = []
def rec(s, add):
    s += add
    if len(s) == n:
        res.append(s)
        return s
    rec(s, 'a')
    rec(s, 'b')
    
rec(s, '')
for i in range(n):
    print(res[i])
