n = int(input())
al = ['a','b','c','d','e','f','g','h','i','j']

dpn = ['']
dpp = ['']*1
l = 1
for i in range(n):
    for j in range(len(dpn)):
        for k in range(i+1):
            if i <= n:
                dpp[j*(i+1)+k] = dpn[j] + al[k]
            else:
                print(dpn[j] + al[k])
    dpn = dpp
    l *= i+2
    dpp = ['']*l
