Solve Problem 39