solve the third problem