Solution to problem 121