n = int(input())

alp = [chr(v) for v in range(ord("a"), ord("z") + 1)]

results = []
def f(i=0, j=0, s="a"):
    if i == n - 1:
        return results.append(s)
    f(i + 1, j, s + alp[j])
    f(i + 1, j + 1, s + alp[j + 1])
f()
print(*results, sep="\n")
