Writing $\left(\mathbf Z/2\oplus\mathbf Z/4\oplus\mathbf Z/8\right)\oplus\left(\mathbf Z/9\oplus\mathbf Z/27\right)$ in a different way

Writing $\left(\mathbf Z\big/2\oplus\mathbf Z\big/4\oplus\mathbf Z\big/8\right)\oplus\left(\mathbf Z\big/9\oplus\mathbf Z\big/27\right)$ in a different way

If $M$ is equal to above how can I find the ideals,(of course of the form $m\mathbf Z$) $I_1,\dots I_n$ such that $I_1\supset I_2\supset \dots I_n$ and $M\simeq\mathbf Z\big/I_1\oplus\dots\oplus\mathbf Z\big /I_n$

(there should be only $1$ way of selecting such ideals, but I don't know how)


We have:

$$M \cong Z/2 \oplus( Z/4 \oplus Z/9) \oplus (Z/8 \oplus Z/27) \cong Z/2 \oplus Z/36 \oplus Z/216$$


Just list the powers of each prime in increasing order right justified and multiply them vertically (using the Chinese Remainder Theorem): \begin{array}{rrr} 2 & 4 & 8 \\ & 9 & 27 \\ \hline 2 & 36 & 216 \\ \end{array} This gives the invariant factors $\mathbb Z/2 \oplus \mathbb Z/36 \oplus \mathbb Z/216$.