A tank can be filled by two pipes. Pipe A can fill the tank in 6 hours, while Pipe B can fill the tank in 9 hours. If both pipes are opened together, but Pipe B is turned off after 3 hours, how long in total will it take to fill the tank? Let's think step by step and output the final answer within \boxed{}.
user