from collections import deque


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

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

    #s = set()
    #l = []
    av = ord('a')
#    zv = ord('z')

    def to_s(ary):
        # return "".join(map(str, ary))
        ans = "".join(map(lambda v: chr(v + av), ary))
        # s.add(ans)
        # l.append(ans)
        return ans

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

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

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

    # print(len(l))
    # print(len(s))


if __name__ == "__main__":
    main()
