Complete solution for p1-p3