Adding solution to P4-13, P4-14 and P4-29 (SM2)