Solver for the bedlam cube