Could anyone please explain clearly, why is it that we have $\displaystyle \mathbb{Z}_6 \oplus \mathbb{Z}_{45} \oplus \mathbb{Z}_5 \cong \mathbb{Z}_2 \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_{3^2} \oplus \mathbb{Z}_5 \oplus \mathbb{Z}_5$,but$\displaystyle \mathbb{Z}_6 \oplus \mathbb{Z}_{45} \oplus \mathbb{Z}_5 \ncong \mathbb{Z}_2 \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_5 \oplus \mathbb{Z}_5$?

So, why is it that $\displaystyle \mathbb{Z}_6 \oplus \mathbb{Z}_{45} \oplus \mathbb{Z}_5$ is isomorphic to the first direct product but not to the second one?

I mean, we can break down $\displaystyle \mathbb{Z}_6 \oplus \mathbb{Z}_{45} \oplus \mathbb{Z}_5$ to the following (which is the same as the first direct product):

$\displaystyle \mathbb{Z}_3 \oplus \mathbb{Z}_{2} \oplus \mathbb{Z}_{3^2}\oplus \mathbb{Z}_{5} \oplus \mathbb{Z}_{5}$

And we further to the following (which is the same as the second direct product):

$\displaystyle \mathbb{Z}_3 \oplus \mathbb{Z}_{2} \oplus \mathbb{Z}_{3} \oplus \mathbb{Z}_{3} \oplus \mathbb{Z}_{5} \oplus \mathbb{Z}_{5}$

So is it not isomorphic to the latter?