No of moles of CO = mass/molar mass = 14/28 = 0.5 mole
No of moles of O2 = 16/32 = 0.5 mole
Since both have same no. of moles, the resulting temperature will be the average of both their temperatures.
... The temperature of the mixture is = (27+47)/2 = 37oC