A system consists of two gases inside a piston. The two gases react to form a solid product. During the reaction, 150 joules of heat are released and the surroundings do 50 joules of work on the system. What is the change in internal energy in joules of the system?