Solve p187