# coding: utf-8
# Your code here!
N=int(input())

cand=["a"]

num=97
for i in range(N-1):
    temp=[]
    for item in cand:
        for i in range(max(ord(item[-1])-95,num-97)):
            temp.append(item+chr(i+97))
            num=max(num,i+97)
    cand=temp[:]

for item in cand:
    print(item)
