Here is the related part of the exercise:
We can solve the problem exhibited in Exercise 2.95 if we use the following modification of the gcd algorithm (