Consider 3 objects, each with different heat capacities ($C_1$, $C_2$, $C_3$) and initial temperatures $T_1$, $T_2$, and $T_3$. Heat engines (HE1 and HE2) are placed between the objects to generate work, which powers a heat pump (HP) to transfer heat from object 2 to object 4. Are the final temperatures of objects 1, 2 and 3 all the same? Or is object 2 colder than objects 1 and 3?
I think the final temperatures of objects 1-3 should be the same, since the heat engines will keep running until there are no temperature differences. HE1 will run until $T_1 = T_2$, and HE2 will run until $T_2=T_3$. By the third law of thermodynamics, we therefore have $T_1=T_3$ at this final stage. I don't think the heat pump should influence this result.
Intuitively, however, it seems like object 2 should be colder in the final stage, since it is the only one rejecting heat to a heat pump.