import sys
from collections import deque


def input():
    return sys.stdin.readline().strip()


MOD = 10 ** 9 + 7
sys.setrecursionlimit(20000000)
INF = float("inf")


def main():
    N = int(input())
    q = deque(["a"])
    cnt = 1
    while cnt <= N:
        d = q.popleft()

        if len(d) == N:
            print(d)
        cnt = max(cnt, len(d))
        a = ord(d[-1])
        for i in range(ord("a"), a + 2):
            q.append(d + chr(i))


if __name__ == "__main__":
    main()
