N = int(input())

#from collections import deque

#Q = deque()

S = "a"

def printer(S):
    if len(S)==N:
        print(S)
    else:
        for i in range(ord('a'),ord(S[-1])+2):        
            printer(S + chr(i))
        
printer(S)