import java.util.*;

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 {
	private static final String NO = "NO";
	private static final String YES = "YES";
	
	public static Outcome outcome(Outcome.Type type, String format, Object... args) {
		return new Outcome(type, String.format(format, args));
	}
	
	@Override
	public Outcome test(InStream inf, InStream ouf, InStream ans) {
		int a = inf.nextInt();
		int b = inf.nextInt();
		int c = inf.nextInt();
		int d = inf.nextInt();
		boolean jAnswer = (YES.equals(ans.nextToken()));
		
		String token = ouf.nextToken();
		boolean cAnswer;
		switch (token) {
		case NO:
			cAnswer = false;
			break;
		case YES:
			cAnswer = true;
			break;
		default:
			return outcome(PE, "Invalid YES/NO token: %s", token);
		}
		
		if (cAnswer) {
			if (jAnswer) {
				return outcome(OK, "Hypothesis is true");
			}
			return outcome(WA, "Output is YES, but the hypothesis is wrong");
		}
		
		int n = ouf.nextInt();
		assert n >= 0 : "Negative number of moves: " + n;
		Set<Move> moves = new HashSet<>();
		for (int i = 0; i < n; i++) {
			int x = ouf.nextInt();
			int y = ouf.nextInt();
			moves.add(new Move(x, y));
		}
		
		if (!covers(moves, a, b)) {
			return outcome(WA, "Wrong counterexample: knight doesn't cover a*b");
		}
		if (covers(moves, c, d)) {
			return outcome(WA, "Wrong counterexample: knight covers c*d");
		}
		if (jAnswer) {
			return outcome(FAIL, "The hypothesis is proven wrong!");
		}
		return outcome(OK, "Hypothesis is false, counterexample is correct");
	}
	
	class Move {
		int x, y;

		public Move(int x, int y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int hashCode() {
			return 1007 * y + x;
		}

		@Override
		public boolean equals(Object obj) {
			Move that = (Move) obj;
			return x == that.x && y == that.y;
		}
	}
	
	boolean covers(Collection<Move> moves, int m, int n) {
		Set<Move> actualMoves = new HashSet<>();
		for (Move move : moves) {
			if (Math.abs(move.x) >= m || Math.abs(move.y) >= n) {
				continue;
			}
			actualMoves.add(move);
		}
		for (boolean forward : new boolean[]{false, true}) {
			boolean[][] mark = new boolean[m][n];
			dfs(mark, actualMoves, 0, 0, forward);
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++) {
					if (!mark[i][j]) {
						return false;
					}
				}
			}
		}
		return true;
	}

	void dfs(boolean[][] mark, Set<Move> moves, int i, int j,	boolean forward) {
		mark[i][j] = true;
		for (Move move : moves) {
			int x = move.x;
			int y = move.y;
			if (!forward) {
				x *= -1;
				y *= -1;
			}
			int iNext = i + x;
			int jNext = j + y;
			if (iNext < 0 || iNext >= mark.length || jNext < 0 || jNext >= mark[0].length) {
				continue;
			}
			if (mark[iNext][jNext]) {
				continue;
			}
			dfs(mark, moves, iNext, jNext, forward);
		}
	}
}
