Let $a,b\in\mathbb N$ be coprime. By manipulating with the matrix $\operatorname{diag}(a,b)$, prove that the cyclic group $Z_{ab}$ is isomorphic to the direct sum $Z_a\oplus Z_b$.
I guess I should obtain the matrix $\operatorname{diag}(1,ab)$ from the matrix $\operatorname{diag}(a,b)$ by elementary (integer) row and column operations (which can be done by a theorem on Smith's normal form), but I don't know how to do that since $a,b$ needn't be invertible, so I cannot multiply rows/columns by them.