Find the maximum of $\operatorname{Tr}(RZ)$ over all orthogonal matrices $R$

Let $A=\sqrt{S}$, and equip the space of $n\times n$ real matrices with the usual Euclidean scalar product. Then $$\hbox{Tr}(RZ)= \hbox{Tr}(RUA^2V^T)=\hbox{Tr}((RUA)(VA)^T)=\langle RUA,VA\rangle$$ By the Cauchy-Schwarz inequality, we get $$\hbox{Tr}(RZ)\leq \Vert RUA \Vert_2 \Vert VA \Vert_2= \Vert A \Vert_2 \Vert A \Vert_2 =\hbox{Tr}(AA^T)=\hbox{Tr}(S)$$ where we used the invariance of the $\Vert \cdot \Vert_2 $ under orthogonal transformations. the converse inequality, is proved by choosing $R=VU^T$, and we are done.