Code for problem 66E.