Two workers, Alice and Bob, are painting a fence. Alice can paint the entire fence in 6 hours, while Bob can do it in 9 hours. They decide to work together for 3 hours, after which Alice leaves and Bob continues to work alone until the fence is finished. How long does it take for Bob to finish the rest of the fence? Let's think step by step and output the final answer within \boxed{}.
user