import itertools
import sys
from string import ascii_lowercase

input = sys.stdin.readline


class Solution:
    def main(self):
        n = int(input())
        done = []
        for i in range(1, n + 1):
            moji = ascii_lowercase[0:i]
            for comb in itertools.combinations_with_replacement(moji, n):
                temp = []
                cnt = 0
                before = ""
                for i, c in enumerate(comb):
                    if i == 0:
                        cnt += 1

                    elif before == c:
                        cnt += 1
                        if i == len(comb) - 1:
                            temp.append(cnt)
                    else:
                        temp.append(cnt)
                        cnt = 1
                    before = c

                f = False
                for d in done:
                    if temp == d:
                        f = True
                        break
                if f:
                    continue
                else:
                    print(''.join(comb))
                    done.append(temp)


# Run main
if __name__ == '__main__':
    Solution().main()
