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

public class Check implements Checker {

    final int MAXX = 2_000_000_000;        

    @Override
    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        int xa, xb, ya, yb, a, b;
        xa = inf.nextInt();
        ya = inf.nextInt();
        xb = inf.nextInt();
        yb = inf.nextInt();
        int w = Math.max(xa - xb, xb - xa);
        int h = Math.max(ya - yb, yb - ya);
        a = inf.nextInt();
        b = inf.nextInt();
        int cw = ouf.nextInt();
        int jw = ans.nextInt();
        if (cw == -1) {
            if (jw == -1)
                return new Outcome(Outcome.Type.OK, String.format("%d", jw));
            else
                return new Outcome(Outcome.Type.WA, "Answer exists, but contestant writes -1");
        }
        int ck1 = ouf.nextInt();
        int ch = ouf.nextInt();
        int ck2 = ouf.nextInt();
        if (cw <= 0 || ch <= 0 || ck1 <= 0 || ck2 <= 0)
            return new Outcome(Outcome.Type.WA, "some number in ans are less or equal zero");
        if (cw > MAXX || ch > MAXX || ck1 > MAXX || ck2 > MAXX)
            return new Outcome(Outcome.Type.WA, "some number in ans are greater than 10^9");
        if (cw < (long)a * ck1)
            return new Outcome(Outcome.Type.WA, "Incorrect width");
        if (ch > (long)b * ck2)
            return new Outcome(Outcome.Type.WA, "Incorrect height");
        long cn1 = (long)w * ck1;
        long cn2 = (long)h * ck2;
        if (cn1 % cw != 0 || cn2 % ch != 0)
            return new Outcome(Outcome.Type.WA, "number of stairs not in N");
        cn1 /= cw;
        cn2 /= ch;
        if (cn1 != cn2)
            return new Outcome(Outcome.Type.WA, "number of stairs is different");
        int jk = ans.nextInt();
        long juryAnswer = (long)w * jk / jw;
        if (cn1 > juryAnswer)
            return new Outcome(Outcome.Type.FAIL, "Contestant answer is correct and better");
        if (cn1 < juryAnswer)
            return new Outcome(Outcome.Type.WA, "number of stairs is not maximal");
        return new Outcome(Outcome.Type.OK, String.format("%d stairs", juryAnswer));
    }
}
