Let m2 , m3 are nuclear masses of X and Y respectively.
The energy, [(m1 + m2) – (m3 + m4)]c2 , that is released or absorbed in a nuclear reaction is called the Q-Value or disintegration energy of the reaction.
Hence, Q = [(m1 + m2) – (m3 + m4 )]c2 J
or, Q = [(m1 + m2) – (m3 + m4)] 931.5 MeV, when masses are in a.m.u.