Solution for problem p26.