N = int(input())
import copy

def nex(lis):
    li = copy.copy(lis)
    if len(li) == N:
        print(''.join([chr(97+i) for i in li]))
        return 

    for x in range(li[-1]+2):
        li2 = copy.copy(li)
        li2.append(x)
        nex(li2)
        
nex([0])