An orange solid (A) on heating gives a green residue (B), a colourless gas (C) and water vapours. The dry gas (C) upon passing over heated Mg gave a white solid (D) which upon subsequent reaction with water gave a gas (E) that gave dense white fumes with HCl. Identify