logic table for 3 inputs - Search