from time import time 

n=int(input())
from itertools import combinations as pe
al=[]
for i in range(n):
    for tu in pe(range(n-1),i):
        if tu:
            pre=tu[0]
            ans="a"*(pre+1)
            for d,v in enumerate(tu[1:]):
                ans+=chr(98+d)*(v-pre);pre=v
            ans+=chr(ord(ans[-1])+1)*(n-len(ans))
            al.append(ans)
        else:print("a"*n)
print(*sorted(al),sep="\n")
