solution for p3