/**
 * Created with IntelliJ IDEA.
 * User: User
 * Date: 20.11.14
 * Time: 22:49
 * To change this template use File | Settings | File Templates.
 */
import ru.ifmo.testlib.*;
import ru.ifmo.testlib.Outcome.Type;

public class Check implements Checker {

    @Override
    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        int query = 0;
        while (!ouf.seekEoF() && !ans.seekEoF()) {
            ++query;
            long cAns = ouf.nextLong();
            long jAns = ans.nextLong();
            if (cAns != jAns)
                return new Outcome(Type.WA, "Contestant answer is wrong on query #" + query);

        }
        if (ans.seekEoF() && ouf.seekEoF())
            return new Outcome(Type.OK, "Jury has same answer");
        if (ans.seekEoF())
            return new Outcome(Type.PE, "Too much tokens in answer");
        if (ouf.seekEoF())
            return new Outcome(Type.PE, "Too less tokens in answer");
        return new Outcome(Type.FAIL, "");
    }
}

