{ NEERC'98 Problem "The dog task"
  Checking program by Roman Elizarov
  20.11.98
}
{$A+,B-,D+,E+,F-,G+,I+,L+,N+,O-,P-,Q+,R+,S+,T-,V+,X+,Y+}
program DOG_CHECK;
uses
  testlib;

const
  max = 100;

var
 x, y, x1, y1: array[1..max] of integer;
 n, m, i, j, prev_pnt: integer;
 c_ans, c_ouf, cc, x0, y0: longint;
 wa, found, prev_place: boolean;
 wmsg: string;

const
  long_size = 8;
  o = 100;

type
  tlong = array[1..long_size] of integer;

procedure LSet ( var l: tlong; n: longint );
var
  i: integer;
begin
  for i:= 1 to long_size do begin
    l[i]:= n mod o;
    n:= n div o;
  end;
  if n <> 0 then
    QUIT ( _Fail, 'Too big numbers' );
end;

procedure LMulShort ( var l: tlong; n: longint );
var
  i: integer;
  rem: longint;
begin
  rem:= 0;
  for i:= 1 to long_size do begin
    inc ( rem, n * l[i] );
    l[i]:= rem mod o;
    rem:= rem div o;
  end;
  if rem <> 0 then
    QUIT ( _Fail, 'Too big numbers' );
end;

function LCmp ( var a, b: tlong ): integer;
var
  i: integer;
begin
  i:= long_size;
  while (i > 1) and (a[i] = b[i]) do
    dec ( i );
  if a[i] < b[i] then
    LCmp:= -1
  else if a[i] > b[i] then
    LCmp:= 1
  else
    LCmp:= 0;
end;

{ "can" - can travel (Xi,Yi) - (X'j,Y'j) - (Xi+1, Yi+1) }
function can ( i, j: integer ): boolean;
var
  sq1, sq2, sq0, rr: longint;
  l, r: tlong;
begin
  sq1:= sqr(longint(x1[j] - x[i])) + sqr(longint(y1[j] - y[i]));
  sq2:= sqr(longint(x1[j] - x[i+1])) + sqr(longint(y1[j] - y[i+1]));
  sq0:= sqr(longint(x[i] - x[i+1])) + sqr(longint(y[i] - y[i+1]));
 {
  can:= (4*sq0 - sq1 - sq2 >= 0) and
        (4*sq1*sq2 <= sqr(4*sq0 - sq1 - sq2));
 }
  rr:= 4*sq0 - sq1 - sq2;
  if rr < 0 then
    can:= false
  else begin
   { r:= sqr(4*sq0 - sq1 - sq2) }
    LSet ( r, rr );
    LMulShort ( r, rr );
   { l:= 4*sq1*sq2 }
    LSet ( l, 4*sq1 );
    LMulShort ( l, sq2 );
   { can:= l <= r }
    can:= lcmp ( l, r ) <= 0;
  end;
end;

begin
 { reading input }
  n:= inf.readlongint;
  m:= inf.readlongint;
  for i:= 1 to n do begin
    x[i]:= inf.readlongint;
    y[i]:= inf.readlongint;
  end;
  for i:= 1 to m do begin
    x1[i]:= inf.readlongint;
    y1[i]:= inf.readlongint;
  end;
 { reading answer }
  c_ans:= ans.readlongint;
 { reading output }
  c_ouf:= ouf.readlongint;
  if not ouf.seekeoln then
    QUIT ( _PE, 'Extra data on first line' );
  ouf.nextLine;
  wa:= false;
  prev_place:= true;
  prev_pnt:= 0;
  for cc:= 1 to c_ouf do begin
    if ouf.seekeoln then
      QUIT ( _PE, 'Extra line in file, or not enough data' );
    x0:= ouf.readlongint;
    if ouf.seekeoln then
      QUIT ( _PE, 'Extra line in file, or not enough data' );
    y0:= ouf.readlongint;
    if wa then
      continue;
    found:= false;
    for i:= 1 to n do
      if (x[i] = x0) and (y[i] = y0) then begin
        if prev_pnt <> i-1 then begin
          wa:= true;
          wmsg:= 'Point skipped';
          break;
        end;
        found:= true;
        prev_place:= false;
        prev_pnt:= i;
        break;
      end;
    if wa then
      continue;
    if not found then
      for i:= 1 to m do
        if (x1[i] = x0) and (y1[i] = y0) then begin
          if prev_place then begin
            wa:= true;
            wmsg:= 'Two interesting places';
            break;
          end;
          if (prev_pnt >= n) or (prev_pnt <= 0) then begin
            wa:= true;
            wmsg:= 'Go to interesting place after last point or before first';
            break;
          end;
          if not can (prev_pnt, i) then begin
            wa:= true;
            wmsg:= 'Invalid visit (not enough speed)';
            break;
          end;
          found:= true;
          prev_place:= true;
          break;
        end;
    if wa then
      continue;
    if not found then begin
      wa:= true;
      wmsg:= 'Point not found: ';
      continue;
    end;
  end;

  if not ouf.seekeof then
    QUIT ( _PE, 'Extra data in output' );

  if c_ouf <> c_ans then
    QUIT ( _WA, 'Wrong count: ');

  if prev_pnt <> n then
    QUIT ( _WA, 'Last point is not visited' );

  if wa then
    QUIT ( _WA, wmsg );

  QUIT ( _OK, 'Ok' );
end.