The following is Theorem II.1.6 in Hungerford's Algebra, which immediately yields your desired conclusion.
Theorem. Let $F$ be a free abelian group of rank $n$, and let $G$ be a nonzero subgroup of $F$. Then there exists a basis $x_1,\ldots,x_n$ of $F$, an integer $r$, $1\leq r\leq n$, and positive integers $d_1,\ldots,d_r$ such that $d_1\mid d_2\mid\cdots\mid d_r$, and $G$ is free abelian with basis $d_1x_1,\ldots,d_rx_r$.
The result you want follows immediately from this.
The proof is inductive on $n$. The result is immediate for $n=1$. Assuming the result for $k\lt n$, let $S$ be the set of all integers $s$ for such that there exists a basis $y_1,\ldots,y_n$ of $F$ such that $sy_1+a_2y_2+\cdots +a_ny_n\in G$. Because $G\neq 0$ and we can replace $y_1$ with $-y_1$, the set $S$ contains positive integers. Since we can replace the basis $y_1,y_2,\ldots,y_n$ with $y_{\sigma(1)},\ldots,y_{\sigma(n)}$ for any permutation $\sigma$ of $\{1,\ldots,n\}$, note that if $a_1y_1+\cdots +a_ny_n\in G$, then $a_i\in S$ for all $i$.
Let $d_1$ be the least positive integer in $S$. Let $y_1,\ldots,y_n$ be a basis for $F$ with $v=d_1y_1+a_2y_2+\cdots +a_ny_n\in G$. Write $a_i=d_1q_i+r_i$ with $0\leq r_i\lt d_1$; then
$$ v = d_1(y_1+q_2y_2+\cdots+q_ny_n) + r_2y_2+\cdots +r_ny_n,$$
and $y_1+q_2y_2+\cdots+q_ny_n,y_2,\ldots,y_n$ is also a basis for $F$. Minimality of $d_1$ implies $r_2=\cdots=r_n=0$. Set $x_1=y_1+q_2y_2+\cdots+q_ny_n$.
Let $H=\langle y_2,\ldots,y_n\rangle$. This is a free abelian group of rank $n=1$, $F=\langle x_1\rangle\oplus H$.
Then $\langle d_1x_1\rangle\cap (G\cap H) = \{0\}$; and if $t_1x_1+t_2x_2+\cdots +t_nx_n\in G$, then applying the division algorithm to write $t_1=d_1q_1+r_1$, $0\leq r_1\lt d_1$, you obtain that
$$v - q_1v = r_1x_1+t_2y_2+\cdots +t_ny_n\in G,$$
so $r_1=0$, and therefore $t_2x_2+\cdots+t_nx_n\in \langle G\cap H$. Therefore, $G = \langle dx_1\rangle\oplus (G\cap H)$.
If $G\cap H=\{0\}$ you are done. Otherwise, applying induction we obtain a basis $x_2,\ldots,x_n$ of $H$ an integer $r$, $2\leq r\leq n$, and positive integers $d_2,\ldots,d_r$ such that $d_2\mid d_3\mid\cdots\mid d_r$ and $d_2x_2,\ldots,d_rx_r$ is a basis for $G\cap H$.
Then $d_1x_1,d_2x_2,\ldots,d_rx_r$ is a basis for $G$. To finish, let $d_2=d_1q+r$ with $0\leq r\lt d_1$. Then $x_2,x_1+qx_2,x_3,\ldots,x_n$ is a basis for $F$, and $rx_2+d_1(x_1+qx_2)\in G$, so $r\in S$. Minimality of $d_1$ yields $r=0$, so $d_1\mid d_2$, completing the proof. $\Box$