On a sunny day, a tree and its shadow form the sides of a right triangle. If the hypotenuse is 50 meters long and the tree is 40 meters tall, how long is the shadow?