finishes problem 9