A bus took a six hour trip and traveled 225 miles. The speed was 40 mph for the first part of the trip, and then decreased to 25 mph for the second part of the trip. How many hours were traveled at each speed?