How $99^{2} \mod 32$ is equal to $3^{2} \mod 32$? I know how to get $99^{2} \mod 32$ from the $(99\mod32)(99\mod32)\mod32$ and get the answer. But the solution guide I have, has converted $$99^{2}\mod32$$ to $$3^{2}\mod32$$. Any idea how?

Just as a more concrete representation, note that
\begin{align}
99^2 & = (3 \times 32 + 3)^2 \\
     & = (3 \times 32)^2 + 2 (3)(3 \times 32) + 3^2 \\
     & = (3 \times 3 \times 32 \times 32) + (2 \times 3 \times 3 \times 32)
       + 3^2 \\
     & = (288 \times 32) + (18 \times 32) + 3^2 \\
     & = (306 \times 32) + 3^2
\end{align}
and hence $99^2 \bmod 32 = 3^2 \bmod 32 = 9 \bmod 32 = 9$.
