The information provided in the problem is that the atomic mass of the element Z is 21.5 amu and the mass of the constituent isotopes of Z is 30 amu and 22 amu. This is not possible as the average mass has to be greater than the mass of the isotope with the least mass.
To calculate the relative abundance in a general case for an element with two isotopes; let the isotope with mass X be x, the abundance of the isotope with mass Y is 1 - x. If the average mass of the element is M solve the equation: M = x*X + (1 - x)*Y
Once x has been determined, the relative abundance of both the constituent isotopes can be derived as x and 1 - x.