import ru.ifmo.testlib.Checker;
import ru.ifmo.testlib.InStream;
import ru.ifmo.testlib.Outcome;

import static ru.ifmo.testlib.Outcome.Type.*;

import java.math.BigInteger;

public class Check implements Checker {

    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        BigInteger ja = ans.nextBigInteger();
        BigInteger pa = ouf.nextBigInteger();

        if (!ouf.seekEoF())
            return new Outcome(Outcome.Type.PE, String.format("Extra data in output file"));

        if (!ja.equals(pa)) {
            return new Outcome(WA, String.format("Expected %d, found %d", ja, pa));
        }
        return new Outcome(OK, String.format("%d", ja));
    }
}
