N = int(input())
ans = ["a"]
for i in range(N-1):
    new = []
    for j in range(len(ans)):
        l = ord(ans[j][-1])-95
        add = [chr(ord("a") + idx) for idx in range(l)]
        for k in add :
            new.append(ans[j] + k)
    ans = new

for p in ans:
    print(p)
     