When 16.8g of white solid, X were heated, 4.4 g of acid gas A, that turned lime water milky was driven off 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 barium chloride solution gave a white precipitate Z. The precipitate effervesced with acid giving of carbon dioxide. Identify, A, B and Y and write down the equation for the thermal decomposition of X.