Problem 31 Solution.