If B was assessed fifteen yards first (assuming B's foul occured first), that would have given A a first down, right? So assessing 15 yards on A still gives them a first down, but 15 yards back, right?
Is that the correct way to do that? That's the only thing I can think of without breaking out the rule book. Because it's late and I'm sore.