Simple C++ Solver for Letterpress