To solve this problem, apply the concepts related to the calculation of the work performed according to the temperature change (in an ideal Carnot cycle), for which you have to:

Where,
C = Heat capacity of the Brick
= Cold Temperature
= Hot Temperature
Integrating,

Our values are given as


Replacing,



Therefore the work perfomed by this ideal carnot engine is 58kJ