Solution to problem 122