import collections
N = int(input())
stack = collections.deque("a")
charset = [chr(ord("a") + i) for i in range(26)]
ans = []
while stack:
    s = stack.pop()
    if len(s) == N:
        ans.append(s)
        continue
    for i in range(charset.index(s[-1]) + 2):
        stack.append(s + charset[i])
[print(a) for a in sorted(ans)]