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

public class Check implements Checker {
    public Outcome outcome(Outcome.Type type, final String format, final Object... args) {
        return new Outcome(type, String.format(format, args));
    }

    private boolean check(int n, int[] partition) {
        int result = 0, sum = 0;
        boolean allPositive = true;
        for (int i = 0; i < partition.length; i++) {
            allPositive &= partition[i] > 0;
            result ^= partition[i];
            sum += partition[i];
        }
        return (allPositive && sum == n && result == 0); 
    }

    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        int n = inf.nextInt();
        int k = inf.nextInt();
        int[] pAns = new int[k];
        int[] jAns = new int[k];
        pAns[0] = ouf.nextInt();
        jAns[0] = ans.nextInt();
        if (jAns[0] == -1) {
            if (pAns[0] == -1) {
                return outcome(OK, "OK, answer doesn\'t exists");
            } else {
                for (int i = 1; i < k; i++) {
                    pAns[i] = ouf.nextInt();
                }
                if (check(n, pAns)) {
                    return outcome(FAIL, "Participant found answer, but jury don\'t");
                } else {
                    return outcome(WA, "Incorrect answer, answer doesn\'t exists, and participant found wrong partition");
                }
            }
        }
        for (int i = 1; i < k; i++) {
            pAns[i] = ouf.nextInt();
        }
        if (check(n, pAns)) {
            return outcome(OK, "Correct answer, good partition");
        } else {
            return outcome(WA, "Incorrect answer, participant found wrong partition");
        }
    }
}
