When 16.8g of white solid X was heated 4.4g of acid gas : (A) that turned lime water milky was driven of together with 1.8g of a gas (B) which condensed to a colourless liquid the solid that remained (Y) dissolved in water to give an alkaline solution, which with excess of BaCl2 solution gave a white precipitate (Z). The precipitate effervescence with acid giving of CO2 gas. Identify the compound A,B and write the chemical equations for the thermal decomposition of X.