import string
alphabet=string.ascii_lowercase

N=int(input())

S=[[] for i in range(N+1)]

S[1].append("a")
for n in range(2,N+1):
    for i in range(len(S[n-1])):
        ikkomae=S[n-1][i]
        #あるものをたす
        list_mozi=list(ikkomae)
        list_mozi=list(dict.fromkeys(list_mozi))
        # print(list_mozi)
        tmp1=ikkomae
        for j in range(len(list_mozi)):
            tmp1=ikkomae+list_mozi[j]
            # print(tmp1)
            S[n].append(tmp1)
        #ないものを足す
        tmp2=ikkomae
        tmp2=tmp2+alphabet[len(list_mozi)]
        # print(tmp2)
        S[n].append(tmp2)

for i in range(len(S[N])):
    print(S[N][i])
