John is driving from City A to City B. He drives the first 60% of the distance at a speed of 50 miles per hour and the remaining 40% at a speed of 30 miles per hour. If the total travel time is 4 hours, what is the distance between City A and City B? Let's think step by step and output the final answer within \boxed{}.
user