import java.util.Scanner

object Main {

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val xyz = List(sc.nextInt, sc.nextInt, sc.nextInt)
    val p = (x: Int) => math.pow(x, 2)
    val enterable = xyz.combinations(2).map(l => math.sqrt(p(l.head) + p(l(1)))).min / 2

    for (i <- 0 until sc.nextInt) {
      val n = sc.nextInt
      println(if (n > enterable) "OK" else "NA")
    }
    sc.close()
  }
}