We can do simple trial and error for the first question. Trying the first machine first then the second gives us an output of -5(sqrt(6-5)=1, 1^2-6=-5), which we do not want. Trying the second machine first then the first (5^2-6=30, sqrt(30-5)=5) gives us 5, which is the correct answer.
We found one solution for the second question, so we know it's possible. Now we are looking to see if any others fit this. We can call the first machine's function f(x), and the second machine's function g(x), and we will just have to example f(g(x)) and g(f(x))
![image](https://img.qammunity.org/2019/formulas/mathematics/middle-school/ln7of57zzzaa1rnttqqmu744jtoao4zwdw.png)
Now, we set f(g(x))=-5, and g(f(x))=-5 to get:
![image](https://img.qammunity.org/2019/formulas/mathematics/middle-school/bmgmdz1uq3lftuu9gjknftgp2lm278cwb3.png)
So we have -6 and 6 as two intial outputs that give us a final output of -5.