#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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

    for(;;){
        int sy, sx, n;
        cin >> sx >> sy >> n;
        if(sx == 0)
            return 0;

        vector<int> py(n), px(n);
        for(int i=0; i<n; ++i)
            cin >> px[i] >> py[i];

        queue<pair<int, int> > q;
        q.push(make_pair(sy, sx));
        for(int i=0; i<9*n+1; ++i){
            vector<vector<bool> > check(10, vector<bool>(10, false));
            int m = q.size();
            while(--m >= 0){
                int y0 = q.front().first;
                int x0 = q.front().second;
                q.pop();
                for(int j=0; j<12; ++j){
                    int y = y0 + dy[j];
                    int x = x0 + dx[j];
                    if(0 <= y && y < 10 && 0 <= x && x < 10 && !check[y][x] && abs(y-py[i%n]) <= 1 && abs(x-px[i%n]) <= 1){
                        q.push(make_pair(y, x));
                        check[y][x] = true;
                    }
                }
            }
        }

        if(!q.empty())
            cout << "OK" << endl;
        else
            cout << "NA" << endl;
    }
}