import itertools

n = int(input())

cl = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", ]


rs=set()
for i in range(n):
    s= ["a"]*(n-i)
    #右からi+1桁目以降のパターンを抽出
    rs |= set(["".join(s + list(l)) for l in itertools.product(cl[:n-1], repeat=i)])
    # for l in  itertools.product(cl[:n],repeat=i):
    #     s+list(l)
rl=list(rs)
rl.sort()
rl.append("".join(cl[:n]))

for r in rl:
    print(r)


