An aqueous solution of salt (A) gives white ppt. (B) with NaCl solution. The filtrate gives black ppt., (C) when H2S is passed into it. Compound (B) dissolves in hot water and the solution gives a yellow ppt., (D) on treatment with sodium iodide and cooling. The compound (A) does not give any gas with dilute HCl but liberates a reddish-brown gas on heating. Identify the compounds (A) to (D).