n=int(input())
s='abcdefghijklmnopqrstuvwxyz'
bottom=[[] for i in range(10)]
bottom[0]=['a']

def solve(n):
    num=0
    while num<=n:
        num=num+1
        for base in bottom[num-1]:
            for i in s[:num+1]:
                if ord(i)-ord(base[-1])>1:continue
                bottom[num].append(base+i)

solve(n-1)
print(*bottom[n-1],sep='\n')