The average of three numbers is 57. The average of two of them is 45. What is the third number.

I tried defining each number as a random variable x, y, z and doing

(x+y+z)/3 = 57 and (x+y)/2 = 45 and solving simulataneously but couldn't get it to work.

any ideas?