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

cand=["a"]


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

for item in cand:
    print(item)
