from collections import deque


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

    #    for c in range(ord('a'), ord('z') + 1):
    # print(chr(c))

    av = ord('a')

    def to_s(ary):
        # return "".join(map(str, ary))
        return "".join(map(lambda v: chr(v+av), ary))

    def search(i, v, n, ary):
        if i >= n:
            print(to_s(ary))
            return

        for u in range(0, v + 2):
            ary[i] = u
            search(i + 1, u, n, ary)

    ary = [0] * N
    search(1, 0, N, ary)


if __name__ == "__main__":
    main()
