cheese = gets.split.map { |e| e.to_i }.sort
l = cheese.combination(2).map{ |x,y| Math.sqrt(x**2 + y**2) }.min
gets.to_i.times { |n|
  r = gets.to_i
  if l < r*2
    puts "OK"
  else
    puts "NA"
  end
}