n = int(input())

abc = list('abcdefghijk')


def solve(ans):
    if len(ans) == n:
        print(*ans, sep='')
    else:
        idx = abc.index(ans[-1])
        for i in range(idx+2):
            nans = ans + [abc[i]]
            solve(nans)


solve(['a'])
