import copy
N=int(input())
alp="abcdefghijklmnopqrstuvwxyz"
l=["a"]
now=[]
flag=0
now=[]

if N==1:
    print(l[0])
    flag=1
else:
    for x in range(N-1):
        for i in range(len(l)):
            now.append(l[i]+"a")
            now.append(l[i]+"b")
        l=copy.deepcopy(now)
        now=[]



if flag!=1:
    l.sort()
    for i in l:
        print(i)
