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

dpn = ['']
dpp = []
for i in range(n):
    for j in dpn:
        for k in al[0:i+1]:
            if i != n-1:
                dpp.append(j+k)
            else:
                print(j+k)
    if i!= n-1:
        dpn = dpp
        dpp = []
