A train travels from A to B at the rate of 20km/hr and from B to A at the rate of 30km/hr,find the average speed.