Solution (source code)

= Solution

Apply the <Snake lemma> degree by degree to a short exact sequence of complexes
$$
0\to A_\bullet\to B_\bullet\to C_\bullet\to0.
$$
If $[c]\in H_n(C)$, lift a cycle $c$ to $b\in B_n$. Its boundary maps to zero in $C_{n-1}$, so it comes from a cycle $a\in A_{n-1}$; define $\partial[c]=[a]$. The Snake-lemma exactness and independence checks yield
$$
\cdots\to H_n(A)\to H_n(B)\to H_n(C)
\xrightarrow{\partial}H_{n-1}(A)\to H_{n-1}(B)\to\cdots.
$$
This is the algebraic <Mayer-Vietoris theorem> for homology objects.