N = int(input())
 
#from collections import deque
 
#Q = deque()
 
S = "a"
 
def printer(S,max_s):
    if len(S)==N:
        print(S)
    else:
        max_s = max(ord(S[-1])-ord('a'),max_s)
        for i in range(ord('a'),ord('a')+max_s+2):        
            printer(S + chr(i),max_s)
        
printer(S,0)