DCJ: I have to disagree a bit. Only Player A, who made the all-in bet AND the Dealer are allowed to stack and physically count Player A's chips. If Player B were to reach over and start staking another players chips, I would immediately disqualify Player B. Depending upon a whole host of conditions, it may not be realistic for player B to accurately verify the stacks being created by the Dealer.
For example, there is a player on the tournament circuit, I have seen him in Las Vegas as well as Tunica, MS, who is blind and requires a "reader" to tell him what his hole and board cards are. Do you suggest that he be responsible to verify something he cannot see?
I am color blind and it is almost impossible for me to tell some dark blue or purple chips from black. If, as described in the question, the stacks are dirty and somewhat hidden, and if the dealer doesn't clarify the difference, I have no way of verifying the actual count of Player A's chips.
These are some of the reasons I submit that the vast majority of the responsibility rests with Player A and the Dealer. The dealer did not do his/her job and Player A has a responsibility, as both Paul and Stuart have indicated to correct errors or mistakes. In my opinion, the TD could invoke TDA Rule #41, the 1st sentence of which says, "Players are obligated to protect the other players in the tournament at all times." I think it entirely within reason for the TD to limit the pot to 51K and to warn/penalize Player A under Rule #41.
Hope this helps!!