n = int(input())

L = []
for i in range(n):
    R = []
    if L == []:
        R.append("a")
    else:
        for j in range(len(L)):
            p1 = L[j] + chr(ord(L[j][-1]))
            R.append(p1)
            
            p2 = L[j] + chr(ord(L[j][-1])+1)
            R.append(p2)
            
    L = R

L = sorted(L)

print("\n".join(L))