Two Carnot engines operate in series such that the heat rejected from one is the heat input to the other. The heat rejected from the high temperature reservoir is 500 kJ. If the overall temperature limits are 1000K and 400K, and both engines produce equal work, determine the intermediate temperature.