n=int(input())
abc='abcdefghih'
L=[]
def dfs(i,a,s):
    if i==n:
        L.append(s)
    else:
        for j in range(0,a+1):
            dfs(i+1,j+1,s+abc[j])
dfs(0,0,'')
L.sort()
for l in L:
    print(l)