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. `60J`
B. `40J`
C. `80J`
D. `20J`