Three liquids are at temperatures of 12°C, 21°C, and 31°C, respectively. Equal masses of the first two liquids are mixed, and the equilibrium temperature is 17°C. Equal masses of the second and third are then mixed, and the equilibrium temperature is 26.5°C. Find the equilibrium temperature when equal masses of the first and third are mixed. Answer in units of °C.