A = [ [ ] for i in range(11)]
A[1].append('a')
n = 1
for i in range(1,10):
    B = A[i]
    for b in B:
        c = b[-1]
        x = ord(c)
        for j in range(97,x+2):
            d = b + chr(j)
            A[i+1].append(d)
N = int(input())
for a in A[N]:
    print(a)