 The average speed of the molecules in "B" will have increased while in "A" they will have slowed down on average.Since average molecular speed corresponds to temperature, the temperature decreases in "A" and increases in "B", contrary to the second law of thermodynamics.A heat engine operating between the thermal reservoirs "A" and "B" could extract useful work from this temperature difference.