Solved medium problem 76.