A car travels from A to B at a speed of 10 km/hr and returns at a speed of 30 km/hr. The average speed of the car for the whole journey is