The correct option is A heat engine
This device is doing positive work on its environment, since it is exerting an outward pressure while it is expanding. Heat engines turn heat into useful work output. Refrigerators absorb work and use the energy to move heat from cold to hot reservoirs. As a pattern, in a cyclic process, clockwise cycles represent positive work done, which is heat engine.