N = int(input())
S = [['a',1]]
import copy

for i in range(N-1):
    tmp = []
    for j in S:
        s = j[0]
        n = j[1]
        for k in range(n+1):
            tmp.append([''.join([s,chr(k+97)]), k+1])
    S = copy.deepcopy(tmp)
for i in S:
    s = i[0]
    print(s)