Two trains, 500 km apart, are travelling towardseach other, one at the speed of 40 kmph and the other at the speed of 60 kmph. A bird starts flying to and fro from one train to the other at a speed of 10kmph. Find the distance covered by the bird from the beginning till one hour before the two trains meet each other.