Solve Exercise 3.12