Context Word: dog. 
Question: Because PersonX owned a cat while PersonY owned a dog, _ needed to buy catnip. 
Answer: PersonX
Because PersonX owned a cat while PersonY owned a dog, _ needed to buy milk-bones.