supermarket logic