First Law of Thermodynamics is defined that the increase in internal energy of system is equal to the sum of heat supplied to the system and work done on system. In words, U = Q + W.
Since heat is gained here, Q is positive. Since work is done on system, W is positive.