An ideal gas is slowly compressed by a piston while thermal energy is removed so that its temperature remains constant. Which of the following correctly gives the signs of the energy transfer by heating Q and the work W for the gas during this process?
(a) Q>0, W<0
(b) Q>0, W>0
(c) Q<0, W>0
(d) Q<0, W<0