Eighty joules are added by heat to a system, while it does 20 J of work. Later, 30 J are added by heat to the system, and it does 40 J of work. What is the change in the system's internal energy?
A. 30 J
B. 110 J
C. 50 J
D. 60 J