d = int(input())
chars = '_abcdefghij'


def solve(L, depth):
    if depth == d:
        print(''.join([chars[i] for i in L]))
        L.pop()
        return
    else:
        for i in range(1, L[depth - 1] + 2):
            L.append(i)
            solve(L, depth + 1)
        L.pop()


solve([1], 1)
