John drives from City A to City B, a distance of 120 miles. On his way to City B, he drives at an average speed of 40 miles per hour. On his return trip, he drives at an average speed of 60 miles per hour. What is the average speed for the entire trip? Let's think step by step and output the final answer within \boxed{}.
user