import sys 
sys.setrecursionlimit(4100000)

N = int(input())
L = []
def dfs(i,s,ord_num):
    if i == N:
        
        if not s in L:
            L.append(s)
            return False
        
        else:
            return False
    
    if dfs(i+1,s + "a",ord_num):
        
        return True
    
    if dfs(i+1,s + chr(ord_num+1),ord_num):
        
        return True
    
    if dfs(i+1,s + chr(ord_num + 1),ord_num + 1):
        
        return True
    
    return False
    
dfs(1,"a",ord("a"))    

L.sort()

for i in L:
    print(i)