Two groups went hiking, leaving at the same time and arriving back at the same time. While one group moved away at the speed 6 mph and then moved back at the speed 4 mph, the other group moved all the way with the same speed. What was the speed of this second group, if both groups covered the same total distance, 24 miles?