n = int(input())
lets = [chr(i) for i in range(ord("a"), ord("a") + n)]
d = {e: i for i, e in enumerate(lets)}

s = ["a"]
for i in range(1, n):
    nxt = []
    for e in s:
        let = e[-1]
        for j in range(d[let] + 2):
            nxt.append(e + lets[j])
    s = nxt

print(*s, sep="\n")
