Context Word: Friend. 
Question: PersonX was really upset that they had treated their friend PersonY badly, so to make it for it _ gave a gift to them. 
Answer: PersonX
PersonX was really upset that they had treated their friend PersonY badly, so to make it for it _ accepted a gift from them.