Solve Problem 18