If A is telling the truth, then B should be a lie, B is a lie, and D should be true. So a can't be the truth.
If B is telling the truth, then A is not a criminal, he is telling the truth. So b is not the truth.
If C is telling the truth, then A is not a criminal, he is telling the truth. So c didn't tell the truth.
Only Ding told the truth, and A, B and C all lied, so Ding and B were not criminals, and A lied to cover up the facts of the crime.