Direct sum of Abelian groups and Isomorphism I'm currently reviewing my algebra for my last prelim and came across the following problem that has me stumped:  If $A,B,C $ are finite Abelian groups such that $A\oplus B \cong A\oplus C$ then show that $B\cong C$.  I'm not really sure where to start; the only thing that comes to mind is the fundamental theorem of finitely generated Abelian groups, I'm not sure if that's useful though. 
I really only want a good hint.
 A: We know that each of $A$, $B$, and $C$ are direct sums of cyclic groups of prime power order,
$$\begin{align*}
A &\cong C_{p_1^{a_1}}\times \cdots \times C_{p_k^{a_k}}\\
B &\cong C_{q_1^{b_1}}\times \cdots \times C_{q_{\ell}^{b_{\ell}}}\\
C &\cong C_{r_1^{c_1}}\times\cdots\times C_{r_m^{c_m}}.
\end{align*}$$
By the Structure Theorem for Finite(ly generated) Abelian groups, these decompositions are unique up to the order of the cyclic factors.
The decomposition of $A\times B$ is obtained by simply concatenating the two decompositions, as is the decomposition for $A\times C$. The fact that the two products are isomorphic means that the multisets
$$\{p_1^{a_1},p_2^{a_2},\ldots,p_k^{a_k},q_1^{b_1},\ldots,q_{\ell}^{b_{\ell}}\}$$
and
$$\{ p_1^{a_1},p_2^{a_2},\ldots,p_k^{a_k},r_1^{c_1},\ldots,r_{m}^{c_m}\}$$
are equal. Subtracting the multiset $\{p_1^{a_1},\ldots,p_k^{a_k}\}$ from both, you get that the multiset of factors for $B$, namely
$$\{ q_1^{b_1},\ldots,q_{\ell}^{b_{\ell}}\}$$
and that for $C$, namely
$$\{ r_1^{c_1},\ldots,r_m^{c_m}\}$$
are in fact identical, which again by the Structure Theorem implies that $B\cong C$.
The result holds more generally for finitely generated abelian groups, but fails once you drop that assumption. (For example, you could take $A$ a product of infinitely many copies of $\mathbb{Z}$, $B$ equal to $\mathbb{Z}$, and $C$ trivial). 
