N=input()
A="abcdefghij"

S=["a"]
for n in range(2,N+1):
    temp=[]
    for s in S:
        for i in range(n):
            if i==n-1:
                if s[-1]==A[i-1]:
                    temp.append(s+A[i])
            else:
                temp.append(s+A[i])
    S=temp

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