Solution
= Solution
The coefficient of the <mixed gauge-gravitational anomaly> is the sum of all left-handed $U(1)$ charges, with right-handed fields counted as conjugates:
$$
\mathcal A_{\mathrm{grav}^2U(1)}=6q+2l-3u-3d-x.
$$
For the solution above,
$$
6+2(-3)-3(4)-3(-2)-(-6)=0.
$$
More invariantly, $l=-3q$, $u+d=2q$, and $x=-6q$ make the expression vanish identically. Thus the unique cubic-anomaly solution automatically cancels the mixed gauge-gravitational anomaly.