N = int(input())


def solve(N):
    if N == 1:
        return ["a"]
    result = []
    for s in solve(N-1):
        result.append(s+'a')
        result.append(s+'b')
    return result

for s in sorted(solve(N)):
    print(s)
