In a thermodynamic process the pressure of a fixed mass of a gas is changed in such a manner that the gas molecules give out 30 J of heat and 10 J of work done on the gas. If the initial internal energy of the gas was 40 J. Then the final internal energy will be ?