alpha_small_ = [chr(i) for i in range(97, 97+26)] #アルファベッドの小文字

n = int(input())
data = [[] for _ in range(n)]
data[0] = [("a",1)]
for i in range(1,n):
    for x,j in data[i-1]:
        for k in range(j+1):
            if k == j:
                data[i].append((x+alpha_small_[k],j+1))
            else:
                data[i].append((x + alpha_small_[k], k+1))

for x in data[-1]:
    print(x[0])