Finitely generated abelian groups: If $G \times K$ is isomorphic to $H \times K$, then $G$ is isomorphic to $H$. Let $G,H,K$ be finitely generated abelian groups.  If $G \times  K$ is isomorphic to $H \times K$, then $G$ is isomorphic to $H$.
What I have thought is that fundamental theorem of abelian groups can be used, but I don't know how to do next.  Please help me.
 A: What does the Fundamental Theorem of finitely generated groups have to say about groups $G, H, K$? And $\;G\times K\;$ and $\;H \times K\;?\;$ 


*

*$G,\;H,\;K.\; G\times K,\;\text{and}\;\;H\times K\;$ are each isomorphic to, and can be expressed uniquely (up to the order of the factors) as, the direct product, whose factors all are cyclic groups of order the power of a prime and/or $\mathbb Z$.


What does this imply if $G\times K \cong H\times K$, each of which is the direct product of abelian groups which are themselves the direct product of cyclic groups? 
Then $K$ be uniquely decomposed into the direct product of cyclic groups. The same for $G\times K$ and $H \times K$, each of which must include all the factors in the in the decomposition of $K$. Then  after taking into account there common factors, since  $G\times K \cong H \times K$, what must be true about $G$ and $H$?
A: Or if you access to A Course on Group Theory by J.J.Rose see this:

Corollary 8.42: Let $G$ be a non-trivial finitely generated abelian group and let $$G=H_1\times...\times H_m=K_1\times ....\times K_n$$ where $m,n$ are positive integers and $H_i,K_j$ are non-trivial indecomposable subgroups of $G$ Then $m=n$ and, by relabeling the suffices if necessary, $$H_i=K_j$$ for each $i=1,...n$

