solve problem 519.