You use substitution and trial and error to answer this, so for A, every time you see an X you'd replace it with 5, and every time you see a Y you'd replace it with -6. Luckily, the answer is a because after substitution, the sum is correct:
5 + (-6) = -1
(3 × 5) - (-6) = 21