write exercise 1-22