Related Rates - Cars Moving at an Intersection

A straight railway track and a straight road intersect at right angles. At a given instant, a motor car at 40 km/h and a train at 50 km/h are moving away from the intersection and are 40 and 30 km respectively from the intersection. At what rate is the distance between them changing one hour later? At what rate would the distance between them be changing at that instant if they were traveling towards the intersection.

Dunno this one as they are 3 variables :(