Let A = value of perpendicular
Let B = value of leg facing side 9
Let C = value of leg facing side 16
We can write the following equations
9^2 + A^2 = B^2
16^2 + A^2 = C^2
B^2 + C^2 = 25^2
Then,
2A^2 + 9^2 + 16^2 = 25^2 , A = 12
9^2 + 12^2 = B^2 , B = 15
16^2 + 12^2 = C^2 C = 20