Buggy python submission (verdict: Runtime Error):
def check(here, count):
	return ((abs(here[0]-s[count][0]))**2 + (abs(here[1]-s[count][1]))**2 <= 2)
		
def dfs(here, count):
	if count == 10:
		result = True
	else:
		result = False
		for dx, dy in delta:
			next = (here[0]+dx,here[1]+dy)
			if lb[0] <= next[0] <= ub[0] and lb[1] <= next[1] <= ub[1] and check(next, count):
				result |= dfs(next, count+1)
	return result
delta = ((2, 0), (2, 1), (2, -1), (0, 2), (1, 2), (-1, 2), 
	(-2, 0), (-2, 1), (-2, -1), (0, -2), (1, -2), (-1, -2)) 

lb = (0,0)
ub = (9,9)
while 1:
	here = map(int,raw_input().split(" "))
	if here == [0,0]:
		break
	n = int(raw_input())
	s = map(int,raw_input().split(" "))
	s = [(s[i*2],s[i*2+1]) for i in range(n)]
	if dfs(here, 0):
		print "OK"
	else:
		print "NA"

Fixed submission:
import sys
def check(here, count):
	return ((abs(here[0]-s[count][0]))**2 + (abs(here[1]-s[count][1]))**2 <= 2)
		
def dfs(here, count):
	if count == n:
		result = True
	else:
		result = False
		for dx, dy in delta:
			next = (here[0]+dx,here[1]+dy)
			if lb[0] <= next[0] <= ub[0] and lb[1] <= next[1] <= ub[1] and check(next, count):
				result |= dfs(next, count+1)
	return result
delta = ((2, 0), (2, 1), (2, -1), (0, 2), (1, 2), (-1, 2), 
	(-2, 0), (-2, 1), (-2, -1), (0, -2), (1, -2), (-1, -2)) 

sys.setrecursionlimit = 1000000
lb = (0,0)
ub = (9,9)
while 1:
	here = map(int,raw_input().split(" "))
	if here == [0,0]:
		break
	n = int(raw_input())
	s = map(int,raw_input().split(" "))
	s = [(s[i*2],s[i*2+1]) for i in range(n)]
	if dfs(here, 0):
		print "OK"
	else:
		print "NA"

Buggy python submission (verdict: Runtime Error):
import sys
def check(here, count):
	return ((abs(here[0]-s[count][0]))**2 + (abs(here[1]-s[count][1]))**2 <= 2)
		
def dfs(here, count):
	if count == 10:
		result = True
	else:
		result = False
		for dx, dy in delta:
			next = (here[0]+dx,here[1]+dy)
			if lb[0] <= next[0] <= ub[0] and lb[1] <= next[1] <= ub[1] and check(next, count):
				result |= dfs(next, count+1)
	return result
delta = ((2, 0), (2, 1), (2, -1), (0, 2), (1, 2), (-1, 2), 
	(-2, 0), (-2, 1), (-2, -1), (0, -2), (1, -2), (-1, -2)) 

sys.setrecursionlimit = 1000000
lb = (0,0)
ub = (9,9)
while 1:
	here = map(int,raw_input().split(" "))
	if here == [0,0]:
		break
	n = int(raw_input())
	s = map(int,raw_input().split(" "))
	s = [(s[i*2],s[i*2+1]) for i in range(n)]
	if dfs(here, 0):
		print "OK"
	else:
		print "NA"

Fixed submission:
import sys
def check(here, count):
	return ((abs(here[0]-s[count][0]))**2 + (abs(here[1]-s[count][1]))**2 <= 2)
		
def dfs(here, count):
	if count == n:
		result = True
	else:
		result = False
		for dx, dy in delta:
			next = (here[0]+dx,here[1]+dy)
			if lb[0] <= next[0] <= ub[0] and lb[1] <= next[1] <= ub[1] and check(next, count):
				result |= dfs(next, count+1)
	return result
delta = ((2, 0), (2, 1), (2, -1), (0, 2), (1, 2), (-1, 2), 
	(-2, 0), (-2, 1), (-2, -1), (0, -2), (1, -2), (-1, -2)) 

sys.setrecursionlimit = 1000000
lb = (0,0)
ub = (9,9)
while 1:
	here = map(int,raw_input().split(" "))
	if here == [0,0]:
		break
	n = int(raw_input())
	s = map(int,raw_input().split(" "))
	s = [(s[i*2],s[i*2+1]) for i in range(n)]
	if dfs(here, 0):
		print "OK"
	else:
		print "NA"