Prepositions play an important part in thermodynamics! Heat may be supplied to a system or lost from it. Work may be done on a gas or by it.
An answer to a question in thermodynamics of “5 joules” is meaningless unless you make it clear and unambiguous whether the system lost 5 joules of heat or gained 5 joules, or whether the gas did 5 joules of work, or you did 5 joules of work on the gas. And it is of no avail to say that the answer is “−5 joules” in the vague hope that I might know what you mean by the minus sign. You must explicitly state in words whether 5 joules was lost or gained – or your reader, or your examiner, will not understand you (and will give you no marks) or will misunderstand you (and will deduct some marks).
I used to tell students that if they wrote “5 joules” without the necessary preposition, they would get no marks for their answer. If they used a preposition, but chose the wrong one (the gas lost 5 joules instead of gaining it) I would take a mark off. Be warned!