n=int(input())
l=["a","b","c","d","e","f","g","h","i","j"]
a="a"
ans=["a"]
for i in range(1,n):
    tt=[]
    for j in l[:i+1]:
        for k in ans:
            tt.append(k+j)
    ans=tt
ans.sort()
for i in ans:
    print(i)