N = int(input())

Char = [chr(97 + i) for i in range(N+10)]

ans = ["a"]
for i in range(N - 1):
    tmp = []
    for a in ans:
        rng = ord(a[-1]) - 97
        for c in Char[: rng + 2]:
            tmp.append(a + c)
    ans = tmp

ans.sort()
print(*ans, sep="\n")
