3D two-temperature magnetohydrodynamic modeling of fast thermal quenches due to injected impurities in tokamaks