A possible mechanism of nanodiamond formation during detonation synthesis