In the first decay, the atomic number is increased by 1 but the mass number remains the same. This can only be beta decay. In beta decay, a fast moving electron is emitted, the mass number remains the same but the atomic number increases by 1.
In second decay, the atomic number decreases by 2. (This may seem confusing as it says there Z-1. However, you must remember that from Z+1, it went to Z – 1.
Overall change = [Z – 1 – (Z + 1)] = [Z – 1 – Z – 1] = (-2)
This means that this must be alpha decay.
In alpha decay, a helium nucleus is emitted. This means that the mass number decreases by 4 and the atomic number decreases by 2. So X = A – 4