Solving problem 9.