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

int main(){
  int w,h,v;
  while(cin >>w>>h>>v, w+h+v){
    int r = w*w + h*h;
    r = min(r , h*h + v*v);
    r = min(r , v*v + w*w);
    double rr = r/4.0;
    int n;
    cin >> n;
    while(n--){
      int rc; cin >> rc;
      rc*=rc;
      if(rr < rc){
        cout << "OK" << endl;
      } else {
        cout << "NA" << endl;
      }
    }
  }
  return 0;
}

      