n = int(input())

stack = [(0, [])]
answers = []
while stack:
    total, digits = stack.pop()
    if total == n:
        answer = []
        is_a = True
        for digit in digits:
            if is_a:
                answer.append('a' * digit)
            else:
                answer.append('b' * digit)
            is_a = not is_a
        answers.append(''.join(answer))

    if total < n:
        for digit in range(1, n - total + 1):
            nxts = list(digits)
            nxts.append(digit)
            stack.append((total + digit, nxts))

answers.sort()
for answer in answers:
    print(answer)
