#include<iostream>
#include<complex>
#include<vector>
#include<cmath>

using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(C)     (C).begin(),(C).end()
#define pb         push_back

const double eps = 1e-10;

typedef complex<double> P;

//lib
double cross(P a,P b){
  return a.real()*b.imag()-a.imag()*b.real();
}

bool isp(P &a,P &b,P &c){
  return abs(a-c)+abs(b-c) < abs(a-b)+eps;
}


bool is_intersected_ls(P & a1,P & a2,P & b1,P & b2){
  if (isp(a1,a2,b1))return true;
  if (isp(a1,a2,b2))return true;
  if (isp(b1,b2,a1))return true;
  if (isp(b1,b2,a2))return true;
  if (cross(a2-a1,b1-a1)*cross(a2-a1,b2-a1)<-eps&&
      cross(b2-b1,a1-b1)*cross(b2-b1,a2-b1)<-eps)return true;
  else return false;
}

P intersection_ls(P & a1,P & a2,P & b1,P & b2){
  P b = b2 - b1;
  double d1=abs(cross(b,a1-b1));
  double d2=abs(cross(b,a2-b1));
  double t = d1/(d1+d2);
  return a1+(a2-a1)*t;
}

double polygon_area(vector<P> & a,int n){
  double sum = 0;
  rep(i,n){
    sum+=(a[i].real()-a[(i+1)%n].real())*(a[i].imag()+a[(i+1)%n].imag());
  }
  return sum/2;
}

double is_in(vector<P> &in,P a){
  int cnt = 0;
  int n = in.size();
  rep(i,n){
    P cur = in[i]-a,next=in[(i+1)%n]-a;
    if (cur.imag() > next.imag())swap(cur,next);
    if (cur.imag()<0 && 0 <= next.imag() && 
	cross(next,cur)>=0)cnt++;
    if (isp(in[i],in[(i+1)%n],a))return true;
  }
  if (cnt %2 == 1)return true;
  else return false;
}


//solve
bool iscrash(vector<P> &a,P b,P c){
  rep(i,a.size()){
    if (is_intersected_ls(a[i],a[(i+1)%a.size()],b,c))return true;
  }
  return false;
}


void output_for_visualize(vector<P> & a){
  int n=a.size();
  cout <<"visualize begin" << endl;
  cout << "[";
  rep(i,a.size()+1){
    cout <<"["<<a[i%n].real()<<","<<a[i%n].imag()<<"],"<<endl;
  }
  cout << "]"<<endl;
}

bool solve(vector<P> &inside,vector<P> &outside,
	   P &start,double laptime,vector<int> &ax,vector<int> &ay){
  vector<P> run;
  P curpos=start,curacc(0,0);
  

  //if is on start line
  if (!isp(inside[0],outside[0],start))return false;

  //start point on the wall
  if (isp(inside[0],inside[1],start)||
      isp(outside[0],outside[1],start))return false;


  //accel is valid?
  rep(i,ax.size()){
    if (ax[i] <-1 || 1 < ax[i] || ay[i] < -1 || 1 < ay[i])return false;
  }



  double clock=0;
  bool isgoal=false;
  bool isstart=false;
  run.pb(curpos);
  rep(i,ax.size()){
    P nextpos;
    curacc.real()+=ax[i];
    curacc.imag()+=ay[i];
    nextpos=curpos+curacc;
    //cout << "[" <<curpos.real()<< "," << curpos.imag() <<"],["<<
    //nextpos.real()<<"," << nextpos.imag()<<"],"<<endl;
    if (!isstart && !isp(inside[0],outside[0],curpos)){clock=1;isstart=true;}
    if ( is_intersected_ls(curpos,nextpos,inside[0],outside[0])
	&& isstart
	){
      if (isgoal)return false;
      P ongoal = intersection_ls(curpos,nextpos,inside[0],outside[0]);
      clock += abs(curpos-ongoal)/abs(curacc);
      if (!(abs(clock-laptime)<0.01))return false;//lap time is incorrect
      run.pb(ongoal);
      isgoal=true;
    }
    clock+=1;
    if (iscrash(inside,curpos,nextpos)||iscrash(outside,curpos,nextpos))
      return false;// crash
    curpos=nextpos;
    if (!isgoal)run.pb(curpos);
  }

  if (!isgoal)return false;// cannot goal

  rep(i,inside.size()){
    if (!is_in(run,inside[i]))return false;//cannot run the course
  }
  
  double area = polygon_area(run,run.size());
  
  if (area > 0)return false;//if area is counter clock wise
  else return true;//if area is clock wise
}



const int END=99999;
main(){
  int te;

  te=1;
  while(te--){
    vector<P> inside,outside;
    double tmpx,tmpy;
    while(true){
      cin>>tmpx;
      if (tmpx == END)break;
      cin>>tmpy;
      inside.pb(P(tmpx,tmpy));
    }

    while(true){
      cin>>tmpx;
      if (tmpx == END)break;
      cin>>tmpy;
      outside.pb(P(tmpx,tmpy));
    }
    
    //output_for_visualize(inside);
    //output_for_visualize(outside);
  


    while(true){
      P start;
      double laptime;
      vector<int> ax,ay;
      int tmp,tax,tay;
      cin>>tmp;
      if (tmp == END)break;
      start.real()=(double)tmp;
      cin>>start.imag();
      cin>>laptime;
      while(true){
	cin>>tax;
	if (tax == END)break;
	cin>>tay;
	ax.pb(tax);
	ay.pb(tay);
      }
      if (solve(inside,outside,start,laptime,ax,ay))puts("OK");
      else puts("NG");
    }

  }
}

Measured memory_bytes: 976