solve problem #7