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