Read it backwards.
Encroachment on B & DB personal foul on A.
Rule 10 Sec 2. Art. 4... Penalties for dead-ball fouls are administered separately and in the order of their occurrence. A dead-ball foul is not coupled with a live-ball foul or another dead-ball foul to create a double or multiple foul.
Rule 9 Sec 4. Art. 3b Personal Foul, Charging Opponent when ball is dead.
Rule 7 Sec 1. Art. 5 Encroachment.