Problem 14: complete solution.