You have 3 unknowns... X, Y, Z, and only two independent equations:
X+Y=Z
Z=50
You can't solve it for a unique solution. All you know is X+Y=50, and there are an infinite number of solutions for X and Y, since the riddle doesn't say the number has to be >= 0.
Unless of course I missed something, and I'm wrong