n=int(input())
def abcd(n,s):
    if len(s)==n:
        print(s)
        return
    if len(s)==0:
        abcd(n,'a')
    else:
        x=ord(s[-1])+1
        for j in range(97,x+1):
            abcd(n,s+chr(j))
    
abcd(n,"")