Solution (source code)

= Solution

The assumed <group> is a <Tarski monster group>. For any $g\ne1$, its cyclic <subgroup> $\langle g\rangle$ must be proper. Otherwise $G$ would be infinite cyclic, and $\langle g^2\rangle$ would be a proper nontrivial infinite <subgroup>, contrary to the hypothesis. Hence $\langle g\rangle$ has order $p$.

Choose $h\notin\langle g\rangle$, possible because $G$ is infinite. The <subgroup> $\langle g,h\rangle$ contains $\langle g\rangle$ strictly. If it were proper, it would have order $p$ and could not strictly contain the order-$p$ <subgroup> $\langle g\rangle$. Therefore
$$
\boxed{G=\langle g,h\rangle.}
$$
In particular, $G$ is a <finitely generated group>, generated by two elements.