import string
import itertools

alphabets = string.ascii_lowercase

N = int(input())

res = []


def bfs(s, d):
    if d == N - 1:
        res.append(s)
        return

    for i in range(ord(s[-1]) - ord("a") + 2):
        bfs(s + alphabets[i], d + 1)


bfs("a", 0)

res = sorted(res)
print("\n".join(res))
# print(list(bfs("a", 0)))
