Given: $T_1 = 1200K, T_2 = T4 = 306K, Q_2 = 30kJ, Q_3 = 270kJ$
(Note: Here T2 and T4 represent the same temperature reservoir, but we use different notation so as to not confuse between the Engine sink and Heat pump sink)
For Heat Engine, the Heat transfer is given by the ratio,
$\frac{Q_1}{Q_2} = \frac{T_1}{TT_2}$
$\frac{Q_1}{30} = \frac{1200}{306}$
$Q_1 = 177.647kJ$
Now, For Energy Balance of Heat Engine,
$W =Q_1 - Q_2$
W = 117.647 - 30 = 87.647kJ
Now, For Energy Balance of Heat Pump,
$Q_4 = W + Q_3$
$Q_4 = 87.647 + 270$
$Q_4 = 357.647kJ$
For Heat Pump, the Heat transfer is given by the ratio,
$\frac{Q_4}{Q_3} = \frac{T_4}{T_3}$
$\frac{357.647}{270} = \frac{306}{T_3}$
$T_3 = 231K = -42^oC$