solve problem6