The total length of 3 pipes is 24 inches. The middle-sized pipe is 6 inches longer than the smallest. The largest is twice as long as the smallest. How long is the middle-sized pipe?