Compute running totals from the largest amount down and assign a class; for example, split products into the top-contributing A class and the rest.