#include<iostream>
#include<cstdio>
using namespace std;

int main() {
  for (int x, y, z; cin >> x >> y >> z, x; ) {
      if (y > z) swap(y, z);
      if (x > y) swap(x, y);
      if (y > z) swap(y, z);

      int T; cin >> T;
      while(T--) {
          int r; cin >> r;
          if (4 * r * r > x * x + y * y)
              cout << "OK" << endl;
          else
              cout << "NA" << endl;
      }
  }
  return 0;
}