Code for problem 69E.