Solving problem 9