from collections import deque

n=int(input())
a_num = ord("a")
deque = deque()
deque.append(("a", a_num))
ans = []

while len(deque) > 0:
    s, s_num = deque.popleft()
    for i in range(a_num, s_num + 2):
        s_nxt = s + chr(i)
        s_num = max(s_num, i)
        if len(s_nxt) == n:
            ans.append(s_nxt)
        else:
            deque.appendleft((s_nxt, s_num))

ans.sort()
print(" ".join(ans))