Solve problem 171