n = int(input())

w = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]


s = ["a"]
ans = [s]

for i in range(2, n+1):
    new_s = []
    for t in s:
        for j in range(1, i):
            if t[-1] == w[j-1]:
                if j == 1:
                    for k in range(i):
                        new_s.append(t + w[k])
                else:
                    for k in range(j-1):
                        new_s.append( t + w[k])
    ans.append(new_s)
    s = new_s
    
for i in range(len(ans[n-1])):
    print(ans[n-1][i]) 
