# -*- coding:utf-8 -*-
import itertools


def solve():
    N = int(input())

    if N == 1:
        print("a")
        return

    lst = ["a", "b"]

    anss = []
    ps = itertools.product(range(2), repeat=N-1)
    for combo in ps:
        ans = "a"
        for x in combo:
            if x == 1:
                ans += "a"
            else:
                ans += "b"
        anss.append(ans)

    anss.sort()
    for ans in anss:
        print(ans)


if __name__ == "__main__":
    solve()
