n=int(input())
L=['a','b','c','d','e','f','g','h','i','j']
ans=['a']
for i in range(2,n+1):
    que=L[:i]
    temp2=[]
    for moji in que:
        temp=[]
        for a in ans:
            a=''.join([a,moji])
            temp.append(a)
        temp2+=temp
    ans=temp2
print(*ans, sep='\n')