problem 50 solution