Show $G$ and $H$ are isomorphic Let $G$ and $H$ be finite abelian groups of the same order $2^n$. If for each integer $m$, $$\left|\left\{x\in G\mid x^{\large 2^m}=1\right\}\right|=\left|\left\{x\in H\mid x^{\large 2^m}=1\right\}\right|$$ then $G$ and $H$ are isomorphic. How to show the above statement? Thanks.

Hint: use the fundamental theorem of finitely generated Abelian groups to determine what kind of factorizations into direct products of cyclic groups that $G$ and $H$ can have. Then use the given fact to conclude something about the cyclic groups that the elements of $G$ and $H$ generate, and use that fact to draw an isomorphism between $G$ and $H$ using the previous factorization. 
