Put the machine with the function y = x^2 - 6 first and then the machine with the function y = sqrt(x-5).
a) In this way, you obtain x = 6 => y = 6^2 - 6 = 36 - 6 = 30 as the output of the first machine and the input of the second machine.
Then the second machine will transform 30 to sqrt (30 - 5) = sqrt (25) = 5, which the the final output wanted.
b) To obtain a final output negative, he must put first the machine with the funcion y = sqrt(x-5)
Suppose you use initial value x = 9
Then the first machine will transform it to sqrt (9-5) = sqrt(4) = 2 and the second machine y = 2^2 -6 = 4 - 6 = -2.