Solution to problem 27