solve problem 1019