import itertools
n =int(input())
alp = [chr(i+96) for i in range(1,n+1)]
cmbs = list(itertools.combinations_with_replacement(alp,n))
for cmb in cmbs:
    flg = False
    for i, al in enumerate(alp):
        if al in cmb:
            for a in alp[0:i]:
                if a not in cmb:
                    flg = True
                    break
            if flg:
                break
    if not flg:
        print(''.join(cmb))