Code for problem 64.