How do magnesium and gold metals react with hydrochloric acid?