include Math

while gets
	l, w, h = $_.chomp.split.map(&:to_i)
	break if [l,w,h].all?(&:zero?)
	cheese_size = [l,w,h].combination(2).map{ |x,y| x*y }.max
	n = gets.to_i
	cheese_ok = Array.new(n,0)
	n.times do |i|
		r = gets.to_i
		entrance_area = PI * r * r
		cheese_ok[i] = (entrance_area < cheese_size ? false : true)
	end
	cheese_ok.each { |b| puts (b ? "OK" : "NA") }
end