I am finding a contradiction between those two theorems and I do not know what I am doing wrong. First theorem is:
The group $\Bbb Z_{m_1} \times \Bbb Z_{m_2} \times \dotsm \times \Bbb Z_{m_n}$ is cyclic and isomorphic to $\Bbb Z_{m_1 m_2 \dotsm m_n}$ if and only if any of $m_i$'s are relatively prime.
And the second theorem is the Fundamental Theorem of Finitely Generated Abelian Groups, which says:
Every finitely generated abelian group $G$ is isomorphic to a direct product of cyclic groups of the form $\Bbb Z_{p_1^{k_1}} \times \Bbb Z_{p_2^{k_2}} \times \dotsm \times \Bbb Z_{p_n^{k_n}}$ where $p_i$'s are not necessarily distinct primes.
For example, by the second theorem, we have $\Bbb Z_{360}$ is isomorphic to $\Bbb Z_2 \times \Bbb Z_2 \times \Bbb Z_2 \times \Bbb Z_3 \times \Bbb Z_3 \times \Bbb Z_5$, but by the first theorem, it should not be, since $2$ and $2$ are not relatively prime. What am I doing wrong here?
Thanks