12 points, help plz.

Here is a number machine.
Input x5
Output -3

a) work out the output when the input is 8

b) work out the input when the output is 42