Exercise 3.26 resolved