def make_move
  move = []
  -1.upto(1) do |i|
    [2, -2].each do |j|
      move << [i, j]
      move << [j, i]
    end
  end
  move
end

def sprinkler_range(sprinklers, i)
  x, y = sprinklers[i]
  range = []
  -1.upto(1) do |i|
    -1.upto(1) do |j|
      range << [x+i, y+j]
    end
  end
  range
end

move = make_move

loop do
  x, y = gets.split.map(&:to_i)
  break if [x, y].all?(&:zero?)
  current = [[x, y]]

  n = gets.to_i

  sprinklers = []
  gets.split.map(&:to_i).each_slice(2){|x| sprinklers << x}

  n.times do |i|
    current_range = sprinkler_range(sprinklers, i)
    temp = []
    
    current.each do |c|
      move.each do |m|
        jump_to = [c[0]+m[0], c[1]+m[1]]
        temp << jump_to if current_range.include? jump_to
      end
    end

    if temp.empty?
      puts "NA"
      break
    elsif i == n-1
      puts "OK"
    else
      current = temp
    end
  end
end  