Draw a cube. The longest distance is from the farthest corner on the bottom to the farthest corner on the top.
.. ..c
a b 9
e 12 d
Can you see the cube, looks more like a tv but whatever.
So from 'c' to 'e' is the distance you are looking for. you know that 'a' to 'b' is 12 and 'b' to 'c' is 9. plug in your triganomic formula of a^2+b^2=c^2 and then you can find the distance from 'a' to 'c'.
Then plug that in again to the same formula for points 'a' to 'c' and then 'c' to 'e' will be your product. this is kind of confusing so the answer is 18.6ft.