Step 1: Name the absolute indices.
Let air, water and glass have absolute refractive indices $\mu_a$, $\mu_w$ and $\mu_g$. A relative index is the ratio of the new medium's index to the old.
Step 2: Write $X$.
Water with respect to air: $X = \dfrac{\mu_w}{\mu_a}$.
Step 3: Write $Y$.
Glass with respect to water: $Y = \dfrac{\mu_g}{\mu_w}$.
Step 4: Write $Z$.
Air with respect to glass: $Z = \dfrac{\mu_a}{\mu_g}$.
Step 5: Multiply the three.
$XYZ = \dfrac{\mu_w}{\mu_a}\cdot\dfrac{\mu_g}{\mu_w}\cdot\dfrac{\mu_a}{\mu_g}$.
Step 6: Cancel everything.
Each index appears once on top and once on the bottom, so $XYZ = 1$, which is option (2).
\[ \boxed{XYZ = 1} \]