Solve problem 12