solve problem4