Code for problem 87A.