I've had the exact same scenario twice. Once was super easy and the agent just changed the segment in Y to A. The other time the agent insisted on doing an exchange. The fare was the same so no big deal. I don't know which way of doing it was "correct".