import sys
n = int(sys.stdin.readline())

ans = [['a']]
plus = ('a', 'b')

for _ in range(n-1):
    l = []
    for s in ans[-1]:
        for x in plus:
            l.append(s+x)
    ans.append(l)

ans[-1].sort()
print('\n'.join(ans[-1]))
