solving P12