Solve problem 47