#10 Solver for problem 28