import string
import itertools

alphabets = string.ascii_lowercase

N = int(input())


def bfs(s, d):
    if d == N - 1:
        print(s)
        return s

    res = []
    for i in range(ord(s[-1]) - ord("a") + 2):
        res.append(bfs(s + alphabets[i], d + 1))
    # return res


bfs("a", 0)
# print(list(bfs("a", 0)))
