from collections import defaultdict
n = int(input())
k = n
D = {}
a ,b , c, d, e, f, g, h, i, j = 'a','b','c','d','e','f','g','h','i','j'
D[1] = [a]
D[2]= [a,b]
D[3] = [a,b,c]
D[4] = [a,b,c,d]
D[5] = [a,b,c,d,e]
D[6] = [a,b,c,d,e,f]
D[7] = [a,b,c,d,e,f,g]
D[8] = [a,b,c,d,e,f,g,h]
D[9] = [a,b,c,d,e,f,g,h,i]
D[10] = [a,b,c,d,e,f,g,h,i,j]

dic = defaultdict(list)
for i in range(n):
    if i+1 == 1:
        s = 'a'
        dic[i+1] = s
    else:
        for j in dic[i]:
            for k in D[i+1]:
                dic[i+1].append(j+k)

    for i in dic[n]:
        print(i)
            