#include <iostream>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;

#define REP(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

class State{
public:
	int cost,x,y;

	State(int _cost,int _x,int _y){
		cost = _cost;
		x = _x;
		y = _y;
	}
};

int dx[] = {-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
int dy[] = {-1,0,1,-2,2,-2,2,-2,2,-1,0,1};

int main(void){
	int sx,sy;

	while(cin>>sx>>sy && (sx||sy)){
		int n;
		cin>>n;

		bool t[10][10][10];
		memset(t,0,sizeof(t));
		rep(i,n){
			int x,y;
			cin>>x>>y;
			REP(j,-1,2) REP(k,-1,2) {
				int nx = x + j;
				int ny = y + k;
				if(nx>=0 && nx<10 && ny>=0 && ny<10) t[i][ny][nx] = true;
			}
		}

		queue<State> open;
		open.push(State(-1,sx,sy));
		bool ans = false;

		while(!open.empty()){
			State st = open.front(); open.pop();

			if(st.cost == n-1){
				ans = true;
				break;
			}

			rep(i,12){
				int nx = st.x + dx[i];
				int ny = st.y + dy[i];
				int nc = st.cost + 1;

				if(nx>=0 && nx<10 && ny>=0 && ny<10 && t[nc][ny][nx]){
					open.push(State(nc,nx,ny));
					t[nc][ny][nx] = false;
				}
			}
		}
		cout<<(ans?"OK":"NG")<<endl;
	}

	return 0;
}