N=input()
A="abcdefghij"

S=["a"]
for n in range(2,N+1):
    temp=[]
    for s in S:
        max_s=max(s)
        ind_max_s=A.index(max_s)
        for i in range(ind_max_s+2):
            temp.append(s+A[i])
    S=temp

S.sort()
for x in S:
    print x
