a = int(input())
al=[chr(ord('a') + i) for i in range(a)]
loop = a
for i in al:
    for j in range(loop-1):
        al.append(i)
    loop = loop-1
import itertools
mm = list(itertools.combinations(al, a))
mm = list(set(mm))
l = []
for i in mm:
    if i[0] == 'a':
        l.append(i)
anslist = sorted(list(set(l)))
for i in anslist:
    print(''.join(i))