What is the work done by a system when it absorbs 50J of heat and gains 24 J of energy?