A is Calcium with atomic number 20. It's stable ion is Ca++. For 6 atoms, 2*6 = 12 electrons are lost.
Thus 12 electrons need to be gained by 4 atoms. Per atom, that's 3 electrons gained. The atom must be then, a group 15 element, say Nitrogen or Phosphorus