solved p1,p2,p3