import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    ans = []

    def solve(s, n):
        if n <= 1:
            ans.append(s)
            return

        for i in range(ord(s[-1]) + 2 - ord('a')):
            solve(s + chr(ord('a') + i), n - 1)

    solve('a', N)
    ans.sort()
    for a in ans:
        print(a)



if __name__ == '__main__':
    main()
