Prolog program to solve "inverting three signals" puzzle.