Solve problem 31.