An element A bums with golden flame in air. It reacts with another element B

An element A bums with golden flame in air. It reacts with another element B, atomic number 17 to give a product C. An aqueous solution of product C on electrolysis gives a compound D and liberates hydrogen. Identify A, B, C and D. Also write down the equations for the reactions involved.

Answer:

image