Solution to Supermarket Technical Problem