A solution to the supermarket technical problem