ProblemSet10: solve p4