#include <iostream>
#include <map>
#include <cstring>	// require memset
//#include <fstream>	// require freopen
//#include <iomanip>	// require setw

using namespace std;

typedef pair<int, int> P;

int field[10][10];

void disp_t (void )
{
	int i, j;

	for (i = 0; i < 10; ++i){
		for (j = 0; j < 10; ++j){
			cout << field[j][i] << ' ';
		} // end for
		cout << endl;
	} // end for
}


P target_pos (int target )
{
	int x, y;
	P res;

	for (x = 0; x <= 10; ++x ){
		for (y = 0; y <= 10; ++y ){
			if (field[x][y] == target ){
				res.first = x; res.second = y;
				break;
			} // end if
		} // end for
	} // end for

	return res;
}
 
bool dfs (int x, int y, int next, int n )
{
	const int dir[][2] = { 
			{ -1, -2 }, {  0, -2 }, {  1, -2 },
			{ -1,  2 }, {  0,  2 }, {  1,  2 },
			{ -2, -1 }, { -2,  0 }, { -2,  1 },
			{  2, -1 }, {  2,  0 }, {  2,  1 }
	};
	const int range[][2] = {
					{ -1, -1 }, { 0, -1 }, { 1, -1 }, 
					{ -1,  0 }, { 0,  0 }, { 1,  0 }, 
					{ -1,  1 }, { 0,  1 }, { 1,  1 } 
	};
//	cout << "target: " << setw(2) << target << endl;
//	cout << "curr: ";
//	cout << '(' << curr_x << ',' << curr_y << ')' << endl;

	if (next > n ){
		return true;
	} // end if

	for (int i = 0; i < 12; ++i ){
		int nx = x + dir[i][0];
		int ny = y + dir[i][1];
		if (nx < 0 || nx >= 10 || ny < 0 || ny >= 10 ){
			continue;
		} // end if
		for (int j = 0; j < 9; ++j ){
			P t = target_pos (next );
			
			int tx = t.first  + range[j][0];
			int ty = t.second + range[j][1];
			if (nx == tx && ny == ty ){
				if (dfs (nx, ny, next + 1, n ) ){
					return true;
				} // end if
			} // end if
		} // end for
	} // end for

	return false;
}
					
int main()
{

//	cut here before submit 
//	freopen ("testcase.phyonkichi", "r", stdin );

	int px, py;

	while (cin >> px >> py && px && py ){
		memset (field, 0, sizeof (field) );
		
		int n;
		cin >> n;

		for (int i = 1; i <= n; ++i ){
			int sx, sy;
			cin >> sx >> sy;
			field[sx][sy] = i;
		} // end for

		disp_t ();

		if (dfs (px, py, 1, n ) ){
			cout << "OK" << endl;
		}else{
			cout << "NA" << endl;
		} // end if
	} // end loop
		
	return 0;
}