# coding: utf-8

# from math import factorial as fact

N = int(input())


w = []


def rec(word):
    length = len(word)

    if length == N:
        w.append(word)
        return None

    tail = word[-1]
    if tail == "z":
        rec(word + "z")
    else:
        rec(word + tail)
        rec(word + chr(ord(tail) + 1))


rec("a")

for word in sorted(w):
    print(word)
