#include <algorithm>
#include <climits>
#include <iostream>

#define loop for (;;)
#define repeat(i, n) for (int i = 0; i < (n); i++)

inline bool inside(double a, double b, int r) {
  return a*a+b*b < r*r;
}

using namespace std;

int main() {
  loop {
    double a, b, c;
    cin >> a >> b >> c;
    if (!(a || b || c)) return 0;
    a /= 2;
    b /= 2;
    c /= 2;
    int n;
    cin >> n;
    repeat(i, n) {
      int r;
      cin >> r;
      if (inside(a, b, r) || inside(b, c, r) || inside(c, a, r))
        cout << "OK" << endl;
      else
        cout << "NA" << endl;
    }
  }
}