from itertools import combinations_with_replacement as cb

N = int(input())
al = [chr(i) for i in range(97, 97 + 26)]

ans = []
for C in cb(al[:N], N):
    if C[0] != 'a': continue
    cur = 'a'
    flag = True

    for i in range(1, N):
        if ord(cur) >= ord(C[i]): continue
        if ord(cur) + 1 == ord(C[i]):
            cur = C[i]
        else: flag = False
    if flag:
        ans.append(''.join(C))

ans.sort()
print(*ans, sep='\n')