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

