Two towns A and B are 100 km apart on a highway. One car starts from A and another from B at the same time. If the cars travel in the same direction, they meet in 5 hours. If they travel towards each other, they meet in 1 hour. Find the speeds of both the cars.