Suppose that $M$ is a submodule of $\mathbb{Z}^n$, but $\mathbb{Z}^n/M$ is not free. We can write
$\mathbb{Z}^n/M \simeq \mathbb{Z}/(q_1)\oplus\cdots\oplus \mathbb{Z}/(q_r) \oplus \mathbb{Z}^t$
for some $r$ and $t$ and $q_1|q_2|\cdots|q_r$.
[Question] I'd like to construct a submodule $M'\subset M$ such that $\mathbb{Z}^n/M'$ is free, specifically, $\mathbb{Z}^n/M' \simeq \mathbb{Z}^{r+t}$. Is this always possible? How should I define $M'$?
(I know how to construct $M'\supset M$ such that it removes the torsion part of $\mathbb{Z}^n/M$, i.e., $\mathbb{Z}^n/M'\simeq \mathbb{Z}^t$. One can simply let $M' = \{x: \text{there exists }a\neq 0\text{ such that } ax\in M\}$. But I am not sure how to shrink $M$ to make $\mathbb{Z}^n/M$ free as desired above.)
Thanks.