n = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
ls = []
# 最初はmake('',3,0)
def make(now):
    if len(now) == n:
        global ls
        ls.append(now)
    for i in range(1,n-len(now)+1):
        nex = now
        if now != '':
            next_chr = alphabet[alphabet.index(now[-1])+1]
        else:
            next_chr = 'a'
        for _ in range(i):
            nex += next_chr
        make(nex)
make('')
m = len(ls)
for i in range(m-1,-1,-1):
    print(ls[i])
            

        

