Solution
let's assume that a1, a2, a3,...an are will mean the relation of first mechanic to valves,
b1, b2, b3, b4...bn are relation of second mechanic to valves, i.e if a1 = 1 then first mechanic must switch the first valve, else no.
let's assume that x1 means whether mechanic to send to switch his valves, x2 for 2-nd mech, so on...
then it's obvious that
a1 * x1 + a2 * x2 + a3 * x3..... = 1 mod 2
b1 * x1 + b2 * x2+ b3 * x3 .... = 1 mod 2
,......
this Linear system equation can be solved by Gaussian algorithm
we need to find only x1, x2, x3,,,,
where if xi (1<= i <= n) is 1 then we will send him, otherwise no.
if the determinant is 0, then No solution...