Phrase: The dog chased the cat, which ran up a tree. It waited at the top.

Question: What does "It" in "It waited" refer to in the phrase?
Option A: The dog; Option B: The cat
Answer: b