solve exercise 39.13