Code for problem 36A.