From points A and B, the distance between which is 1020 mi, two trains left simultaneously towards each other. The speed of one train was 10 mph greater than the speed of the other one. In 5 hours the trains had not met yet and were 170 mi apart. Find the speed of the trains.