Solved medium problem 60.