Given $G$, $H$, $G'$, and $H'$ are cyclic groups of orders $m$, $n$, $m'$, and $n'$ respectively.
If $G*H$ is isomorphic to $G'* H'$, I would like to show that either $m = m'$ and $n = n'$ or else $m = n'$ and $n = m'$ holds. Where * denotes the free product.
My approach:
$G*H$ has an element of order $n$, thus $G' * H'$ has one too.
But already the next step is not clear to me, should I show that there is an element of length $> 1$ which has infinite order or what would be the right approach here?
Thank you.