n = int(input())
ans = []
for i in range(2 ** n):
    s = ['a'] * n
    for j in range(n):
        if ((i >> j) & 1):
            s[n - 1 - j] = 'b'
    ans.append(''.join(s))
ans.sort()
for i in ans:
    if i[0] != 'b':
        print(i)