#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;
 
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair
 
static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;
 
template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
    v.assign(a,vector<T>(b,t));
}
 
//v.erase(unique(v.begin(),v.end()),v.end());

int vt[]={-1,0,1};
int vy[]={-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
int vx[]={-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
vector<pii> foo(pii a,pii b){
	vector<pii> ret;
	rep(i,3){
		rep(j,3){
			int x=a.F+vt[i],y=a.S+vt[j];
			
			if(-1<x&&x<10&&-1<y&&y<10){
				rep(k,12){
					int d=b.F+vx[k],e=b.S+vy[k];
					if(-1<d&&d<10&&-1<e&&e<10){
						if(d==x&&e==y){
							ret.PB(mkp(x,y));
						}
					}
				}
			}
		}
	}
	return ret;
}

int main(){
	vector<vint> vv;
	initvv(vv,10,10);
	while(1){
		vector<pii> v(1);
		cin>>v[0].F>>v[0].S;
		if(v[0].F==0&&v[0].S==0) break;
		int n;
		cin>>n;
		vector<pii> x(n);
		rep(i,n){
			cin>>x[i].F>>x[i].S;
		}
		bool f=true;
		rep(i,n){
			vector<pii> tmp;
			rep(j,v.size()){
				vector<pii> a=foo(x[i],v[j]);
				rep(k,a.size()){
					tmp.PB(a[k]);
				}
			}
			sort(ALL(tmp));
			tmp.erase(unique(tmp.begin(),tmp.end()),tmp.end());
			v=tmp;
			if(v.size()==0){
				f=false;
				break;
			}
		}
		if(f) cout<<"OK\n";
		else cout<<"NA\n";
		
	}
}