import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class CircuitoCombinacional {
    public static void main(String[] args) throws IOException {
        Source a = new Source();
        Source b = new Source();
        Source c = new Source();
        And ab = new And(a,b);
        Or ab_c = new Or(c, ab);
        Scanner s = new Scanner(new File(args[0]));
        System.out.println("f(a,b,c)= a and b or c");
        while (s.hasNextLine()) {
            a.setValue(s.nextInt()==1?true:false);
            b.setValue(s.nextInt()==1?true:false);
            c.setValue(s.nextInt()==1?true:false);
            System.out.println(a.getValue()+" and "+b.getValue()+ " or "+c.getValue()+" = "+ab_c.getValue());
        }
    }
}
