For this case what you should know is the statement of the first law of thermodynamics.
By definition, we have to:
<em>This law establishes that energy is not created, nor destroyed, but is conserved.
</em>
<em>Then we have that when a certain system is subjected to a thermodynamic cycle, the heat given by the system will be equal to the work received by it, and vice versa.
</em>