Pipe A alone can fill an empty pool in 6 hours. Pipe B alone can fill it in 9 hours. A drain alone can empty a full pool in 18 hours. The pool is empty, and both pipes and the drain are opened at the same time. How many hours does it take to fill the pool?