
import std.stdio, std.algorithm, std.array, std.math;

void main() {
  for(double w, h, d; readf("%f %f %f\n", &w, &h, &d), w + h + d != 0;) {
    double[] arr = sort([w, h, d]).array;
    double n; readf("%f\n", &n);
    foreach(i; 0..n) {
      double k;
      readf("%f\n", &k);
      writeln(pow((k * 2), 2) - pow(arr[0], 2) <= pow(arr[1], 2)  ? "NA" : "OK");
    }
  }
}