while true
    size = gets.chomp.split.map(&:to_f).sort
    break if size == [0, 0, 0]
    limit = (size[0] / 2) ** 2 + (size[1] / 2) ** 2
    gets.to_i.times{puts (gets.to_i ** 2 > limit) ? "OK" : "NA"}
end

