Problem 19 solution.