N = int(input())

que = ['a']
res = []
for i in range(1, N):
    for q in que:
        res.append(q + 'a')
        res.append(q + 'b')
    que = res
    res = []

que.sort()
for q in que:
    print(q)