Solution (source code)

= Solution

Let $w$ be a nonempty reduced word. If its first syllable belongs to $G$, choose any nonidentity $h\in H$. The reduced form of $hw$ begins with an $H$-syllable, whereas that of $wh$ begins with the original $G$-syllable; reduction at the right end cannot change the first syllable. Hence $hw\ne wh$. The same argument with a nonidentity $g\in G$ applies when $w$ begins in $H$. No nonidentity element is therefore central, and
$$
\boxed{Z(G*H)=1.}
$$