// Collider2 problem checker
// Author : Vladimir Ulyantsev, ulyantsev@rain.ifmo.ru

uses
    testlib, sysutils;
type
	int = longint;
const
	maxn = 2000;
	maxx = 1000000000;
var
	jAnsSize, pAnsSize : int;
	n, i : int;
	x, y : array [1..maxn + 2] of int;

function containsSquare(n : int) : boolean;
var
	i, j, t : int;

function search(xp, yp : int) : boolean;
var
	l, r, m : int;
begin
	l := 1;
	r := n;
	result := false;
	while (l <= r) do begin
		m := (r + l) div 2;
		if ((x[m] = xp) and (y[m] = yp)) then begin
			result := true;
			break;
		end else if ((x[m] > xp) or ((x[m] = xp) and (y[m] > yp))) then
			r := m - 1
		else
			l := m + 1;
	end;
end;

begin
	for i := 1 to n do begin
		for j := 2 to n do begin
			if ((x[j - 1] > x[j]) or ((x[j - 1] = x[j]) and (y[j - 1] > y[j]))) then begin
				t := x[j - 1];
				x[j - 1] := x[j];
				x[j] := t;
				t := y[j - 1];
				y[j - 1] := y[j];
				y[j] := t;
			end;
		end;
	end;
	
	result := false;
	for i := 1 to n do 
		for j := 1 to n do 
			if ((i <> j) and search(x[i] + y[j] - y[i], y[i] - x[j] + x[i]) and
							 search(x[j] - y[i] + y[j], y[j] + x[i] - x[j])) then
				result := true;
end;

begin
    jAnsSize := ans.readLongint;
    pAnsSize := ouf.readLongint;
    if ((pAnsSize < 0) or (pAnsSize > 3)) then
      quit(_wa, 'Answer is negative or more than 3');

    if (pAnsSize > jAnsSize) then
    	quit(_wa, 'Answer size ' + inttostr(jAnsSize) + ' expected, ' + inttostr(pAnsSize) + ' found');

    n := inf.readLongint;
    for i := 1 to n do begin
    	x[i] := inf.readLongint;
		y[i] := inf.readLongint;
    end;
    
    for i := n + 1 to n + pAnsSize do begin
    	x[i] := ouf.readLongint;
    	if ((x[i] < -maxx) or (x[i] > maxx)) then
    		quit(_pe, 'ansX[' + inttostr(i - n) + '] is out of bounds');

		y[i] := ouf.readLongint;
    	if ((y[i] < -maxx) or (y[i] > maxx)) then
    		quit(_pe, 'ansY[' + inttostr(i - n) + '] is out of bounds');
    end;

    if (not containsSquare(n + pAnsSize)) then
    	quit(_wa, 'There is no square after adding ' + inttostr(pAnsSize) + ' points');
	
	if (pAnsSize < jAnsSize) then
		quit(_fail, 'Contestant has a better answer');

	quit(_ok, 'Answer size is ' + inttostr(jAnsSize));
end.
