solve problem 8