solve p_4