Solution (source code)

= Solution

The first three terms are the scalar kinetic, mass, and $n$-point interaction terms. The remaining terms are the field-strength, mass, and coupling <counterterm>[counterterms]. The momentum-space rules are
$$
\frac{i}{p^2-m^2+i\epsilon},\qquad -i\lambda,
\qquad i(\delta_Zp^2-\delta_{m^2}),\qquad -i\delta_\lambda,
$$
for a propagator, an $n$-leg interaction vertex, a two-leg counterterm insertion, and an $n$-leg counterterm vertex, respectively, together with momentum conservation at every vertex.