We can use a new data structure.
For example, make an auxiliary variable t = [x, z-x].
t.1 = x
t.2 = y
sum(t) = z