import math


data = [ "a","b","c","d","e","f","g","h","i","j" ]


result = []


def create( max_letter, remaining_depth, text ):
    if remaining_depth == 0:
        result.append(text)
        return
    
    for i in range(0,max_letter+1):
        new_text = text + data[i]
        create( i+1,remaining_depth-1,new_text )
        
    
        
        





N = int(input())

create( 0,N,"")

result.sort()
for line in result:
    print(line)










    

    
        
    
                
    

