magnesium and bromine react with each other to form a sustan