Solution to the cash register problem.