N = int(input())

pre = ["a"]
for n in range(N - 1):
    nex = []
    for v in pre:
        for i in range(ord("a"), ord(v[-1]) + 2):
            nex.append(v + chr(i))
    pre = nex[:]
        
print(*sorted(pre), sep="\n")
