Solution for problem 56.