import itertools
alp = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
N = int(input())
cnt = 0
c = itertools.product(alp[:N], repeat=N)
for j in c:
    if alp[:len(set(j))] != sorted(list(set(j))):
        continue
    print(''.join(j))
    if list(j) == alp[:len(j)]:
        break
