#include <bits/stdc++.h>
using namespace std;

int main() {
    while (true) {
        int px, py; cin >> px >> py;
        if (px==0) break;
        int n; cin >> n;
        bool dp[10][10];
        for (int i=0; i<10; i++) for (int j=0; j<10; j++) dp[i][j] = false;
        dp[py][px] = true;
        bool ndp[10][10];
        bool judge = true;
        
        for (int i=0; i<n; i++) {
            for (int j=0; j<10; j++) for (int k=0; k<10; k++) ndp[j][k] = false;
            for (int j=0; j<10; j++) {
                for (int k=0; k<10; k++) {
                    if (j-2>=0) for (int l=k-1; l<=k+1; l++) if (0<=l && l<10) ndp[j-2][l] |= dp[j][k];
                    if (j+2<10) for (int l=k-1; l<=k+1; l++) if (0<=l && l<10) ndp[j+2][l] |= dp[j][k];
                    if (k-2>=0) for (int l=j-1; l<=j+1; l++) if (0<=l && l<10) ndp[l][k-2] |= dp[j][k];
                    if (k+2<10) for (int l=j-1; l<=j+1; l++) if (0<=l && l<10) ndp[l][k+2] |= dp[j][k];
                }
            }
            
            int xi, yi; cin >> xi >> yi;
            swap(xi, yi);
            bool flag = false;
            
            for (int dx=-1; dx<=1; dx++) {
                for (int dy=-1; dy<=1; dy++) {
                    if (!(0<=xi+dx && xi+dx<10 && 0<=yi+dy && yi+dy<10)) continue;
                    if (ndp[xi+dx][yi+dy]) flag = true;
                }
            }
            
            judge &= flag;
            
            for (int j=0; j<10; j++) {
                for (int k=0; k<10; k++) {
                    if (!(xi-1<=j && j<=xi+1 && yi-1<=k && k<=yi+1)) ndp[j][k] = false;
                }
            }
            
            swap(dp, ndp);
        }
        
        cout << (judge ? "OK":"NA") << endl;
    }
}
