Code for problem 25A.