Code for problem 76E.