The electrons in the outer most orbit of X, Y and Z atom are 7, 2 and 3 respectively. The valencies of the atoms are:
1, 2,3
The atom X has 7 electrons in outer orbit, it needs 1 electron to attain octet.
Y has 2 electrons, it prefers to get rid of 2 electrons than to get 6 electrons to complete octet.
Similarly Z prefers to lose 3 electrons than getting 5 electrons.
So, valency (combining capacity) of X, Y, Z respectively are 1, 2, 3 respectively.