begin to solve problem 9