Iris pointed out to me that I had forgotten to specify that the machine is not allowed to have both of its lights on. Of course that was the idea, because else the question would be too trivial.