import itertools

N = int(input())

alpha = 'abcdefghijklmnopqrstuvwxyz'

text = alpha[:N]

textl = list(itertools.product(text, repeat=N))
S = len(textl) // 2
newtextl = textl[:S]
for ans in newtextl:
    ansl = ''.join(ans)
    print(ansl)