Alright, this is similar to a question that I have answered before but I will just give you the reasoning for this phenomenon. I will not give you the answer since this appears to be a homework question.
Why an atom gains energy when you take off an electron?
Well for this, think of the attractions between the nucleus and the electrons, so when you must strip away an electron from this stability, you must add energy to do so.
Why an atom releases energy when you add an electron?
This one might be a little hard to grasp, but at the end it is not too bad. Essentially the molecule is becoming more stable. It is getting near to having a full octet. (Ignoring noble gasses). In other words the kinetic energy added by gaining the electron is released when the atom is achieving a stable state.
This is the general reasoning behind this, not too complicated, but I hope you will be able to understand it. Just, if you can't, remember the first one and think of the opposite for the second one.
Now, take a look at this question, to help you with your question even more. You will then be able to deduce the correct answer.