Let the radius of $R$'s track be $r$ and let the radius of the
first semicircle of $P$'s track be $p$; then the radius of the
second circle of this track is $r-p$.
The total length of $P$'s track is $\pi p + \pi(r-p) = \pi r$, the
same length as $R$'s track.
By a similar argument, the length of $Q$'s track is also $\pi r$.