n = int(input())
L = [['a','a']]
for i in range(1,n):
    new = []
    for j in range(len(L)):
        temp = L[j][1]
        cur = ord(L[j][0])-96
        for k in range(cur+1):
            ap = temp+chr(97+k)
            if chr(97+k) < L[j][0]:
                new.append([L[j][0], ap])
            else:
                new.append([chr(97+k), ap])
    L = new
L.sort()
for i in range(len(L)):
    print(L[i][1])
