If heat (q) is flowing out of the system going into the surroundings and work (w) leaving the surroundings going
into the system. Is the delta E sys positive or negative.
System inside a green box a yellow arrow with heat written inside the arrow going toward surroundings
and another yellow arrow with work written inside the arrow going into the system inside the green box. I hope this works for you. I couldn't copy and paste the pic. I hope this explains more in detail.