A is Magnesium, B is Aluminium both are adjacent element and lie in third period.
Magnesium with atomic number of 12 consist two s electrons in it's valence shell in ground state whereas, Aluminium which has atomic number of 13 consist three electrons in it's valence shell in the ground state out of which two are s electrons and only one p electron.
Salts are compounds that contain positively charged ions and negatively charged ions. That is; they consist of the positive ion of a base and the negative ion of an acid.
Salts may be produced when acids and bases are combined together in equal proportions, a process called neutralization.
During neutralization reactions an acid reacts with a base to form a salt and water as the only products.