Solve problem 147