n=int(input())
li=["a"]
alpha=["a","b","c","d","e","f","g","h","i","j"]
if n==1:
    print("a")
else:
    for i in range(n-1):
        ans=[]
        for j in range(len(li)):
            if len(set(li[j]))==1:
                ans.append(li[j]+"a")
                ans.append(li[j]+"b")
            else:
                for k in range(i+2):
                    ans.append(li[j]+alpha[k])
        li=ans
for i in range(len(ans)):
    print(ans[i])

