A bead slides frictionlessly under gravity $g$ down a cycloid curve defined parametrically by $x(\theta) = R(\theta - \sin\theta)$ and $y(\theta) = R(1 - \cos\theta)$. What is the exact time $T$ required to reach the lowest point ($\theta = \pi$) starting from rest at the origin? Express your answer in terms of $R$, $g$, and $\pi$.