notice the picture below, the perpendicular line from the right-angle,
makes up 3 similar triangles, including the big one containing the small ones
so, you have three similar triangles, one large, a medium and a small one
now, using proportions for those folks, we end up with
[tex]\bf \cfrac{\textit{large side}}{\textit{small side}}\qquad \cfrac{25}{x}=\cfrac{x}{9}
\\\\
\\\\
\cfrac{\textit{small side}}{\textit{medium side}}\qquad \cfrac{y}{16}=\cfrac{9}{y}
\\\\
\\\\
\cfrac{\textit{medium side}}{\textit{large side}}\qquad \cfrac{z}{25}=\cfrac{16}{z}[/tex]
solve for "x,y and z"