I am stuck on this problem please help!

X. Y. Outcome
A. 10. Gain
B. -10. Gain

How do I write my formula ?
If x =A and Y is positve. Outcome is gain
If x =A and Y is negative. Outcome is loss
If x=B and Y is positive. Outcome is loss
If x=B and Y is negative. Outcome is gain

Can somebody help.
Million thanks!!!!!