n = int(input())

stack = [(0, [])]
answers = []
while stack:
    total, digits = stack.pop()
    if total == n:
        buffers = [['a' * digits[0]]]
        alphabets = 'abcdefghiljlmnopqrstuvwxyz'
        while buffers:
            buffer = buffers.pop()
            if len(buffer) == len(digits):
                answers.append(''.join(buffer))
                continue

            x = alphabets.index(buffer[-1][0])
            for i in range(x + 2):
                if i == x: 
                    continue
                nxts = list(buffer)
                nxts.append(alphabets[i] * digits[len(buffer)])
                buffers.append(nxts)

        #     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)
