Halogen-hydride interaction between Z-X (Z = CN, NC; X = F, Cl, Br) and H-Mg-Y (Y = H, F, Cl, Br, CH3).