The [tex]\delta E[/tex], the variation of energy of the system, is given by
[tex]\delta E =+45 J - 82 J =-37 J[/tex]
The value of the energy variation is negative, because the system lost more heat (82 J) than what it received (45 J), and for the sign convention of the first law of thermodynamics, the heat lost by a system is expressed as a negative number.