import sys 
sys.setrecursionlimit(4100000)

N = int(input())

def dfs(i,s):
    if len(s) == N:
        
        return print(s)
    
    for x in range(97,i + 1):
        t = s + chr(x)
        
        dfs(x + 1,t)
    
    
dfs(ord("a"),"")    