Solution for problem 57.