In what order should you stack the machines so that when 15 is dropped into the first machine, and all four machines have had their effect, the last machine’s output is -6?

Please help me with my algebra homework!

The four functions are below:

1. y=-2x+34    2. y=(-x/3)-10

3. y=-|3x|        4. y=(x-2)^2

a. In what order should you stack the machines so that when 15 is dropped into the first machine, and all four machines have had their effect, the last machine’s output is -6?

b. What order will result in a final output of 2 when the first imput is 8?