The pole had to be 30 feet tall.
When the whole thing was set up, it looked like a right-angled triangle.
As we know, right angled triangles are always in a 3:4:5 ratio, where 5 is the longest side.
In this case we already knew that the longest side was 50, which simplified to 5, and the other side was 40, which simplified to 4. That means because it was a right-angled triangle, the other side had to be 30, which simplified to 3 and completed the ratio.