Solution for problem 59.