Two towns p and q are connected by a regular bus service with a bus leaving in either direction every T min

Two towns p and q are connected by a regular bus service with a bus leaving in either direction every T min. A man cycling with a speed of 20 kmh-1 in the direction p to q notices that a bus goes past him every 18 min in the direction of his motion and every 6 min in opposite direction. What is the period T of the bus service and with what speed (assumed constant) do the buses ply on the road ?