import java.util.*;

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

//import testlib.*;

public class Check implements Checker {
	int[] ldx, ldy, rux, ruy;
	
	boolean inRect(int x, int y, int i) {
		if (i == 0) return false;
		return (x >= ldx[i] && x <= rux[i] && y >= ldy[i] && y <= ruy[i]);
	}
	
	int n, m;
	boolean inField(int x, int y){
		return (x >= 0 && x < n && y >= 0 && y < m);
	}
	public Outcome test(InStream inf, InStream ouf, InStream ans) {
		boolean f = (ans.nextLine().equals("Impossible"));
		if (f == true) {
			if (ouf.nextLine().equals("Impossible")) return new Outcome(Type.OK, "Impossible" ); else
			 return new Outcome(Type.WA, "He is wrong");
		}	
		n = inf.nextInt();
		m = inf.nextInt();
		int k = inf.nextInt();
		
		ldx = new int[k+1];
		ldy = new int[k+1];
		rux = new int[k+1];
		ruy = new int[k+1];
		for (int i = 0; i < k; i++) {
			ldx[i] = inf.nextInt() - 1;
			ldy[i] = inf.nextInt() - 1;
			rux[i] = inf.nextInt() - 1;
			ruy[i] = inf.nextInt() - 1;
		}
		int x = ouf.nextInt() - 1;
		int y = ouf.nextInt() - 1;
		if (!inField(x, y) || inRect(x, y, 0)) return new Outcome(Type.WA, "Bad cell " + String.valueOf(0));
		for (int i = 1; i < k; i++) {
			int x2 = ouf.nextInt() - 1;
			int y2 = ouf.nextInt() - 1;
			if (Math.abs(x2 - x) + Math.abs(y2 - y) > 1) return new Outcome(Type.WA, "Bad step " + String.valueOf(i + 1));
			if (!inField(x2, y2) || inRect(x2, y2, i)) {
				return new Outcome(Type.WA, "Bad cell " + String.valueOf(i + 1));
			}
			x = x2;
			y = y2;
		} 
		if (f == true) return new Outcome(Type.FAIL, "Oh, no, they found answer");
		return new Outcome(Type.OK, "");
	}
}