Code for problem 337A.