If Ding tells a lie, then Ding is a criminal, which contradicts the lie told by C, so it is not Ding.
If B is lying, then A is not, D is not, and C says B, which should be true.
The answer is B.