Well, i tried to establish the mass balance equation which is number 1. I figured that we don't know what the initial concentration of X is, but as the last sentence of the problem says, the number of moles of X is equal to the number of moles of Ag. Therefore, in solution Ag reacts in multiple steps and so the concentration of each of these products ([Ag] + [Ag(NH3)] + [Ag(NH3)2]) added should be equal to the sum of Ag.
Equation 2 is based on the fact that we know the concentration of NH3 added which was 2.0M initially, but after it was added to the solution, we see that NH3 also reacts in multiple reactions so the concentration of NH3 (which is 2.0M) is a summation of [NH3] + [NH4] + [Ag(NH3)2] + [Ag(NH3)].
Equation 3 is the standard water dissociation reaction, however, since ammonia also reacts with water giving us ammonium and hydroxide, we need to incorporate both of these values into the equation so that the concentration of hydroxide (which is 10^-7) is equal to the concentration of hydronium and ammonium.
Equation 4 is just charge balance.
So I did some substitutions and rearrangements, and I believe we need to make an assumption that the concentration of Ag(NH3)2 and Ag(NH3) can be neglected since (based on the k value) they will not be so significant in concentration.