A gas undergoes a change of state during which 100J of heat is supplied to it and it does 20J of work. The system is brough back to its original state through a process during which 20 J of heat is released by the gas. What is the work done by the gas in the second process?
A. 60 J
B. 40 J
C. 80 J
D. 20 J