N = int(input())
# alpha = [chr(ord("a")+i) for i in range(10)]
ans = [[] for _ in range(N)]
ans[0].append("a")
for i in range(N-1):
    for e in ans[i]:
        idx = ord(e[-1]) - ord("a")
        for j in range(idx+2):
            ans[i+1].append(e+chr(ord("a")+j))
for e1 in ans:
    for e2 in e1:
        print(e2)