from itertools import product
n=int(input())
s='abcdefghijklmnopqrstuvwxyz'
use_s=s[:n]
#print(use_s,1)
for i in product(list(use_s), repeat=n):
    ans=''.join(i)
    if use_s<ans:continue
    print(ans)