#include <bits/stdc++.h>
using namespace std;

int main() {
  double a[3];
  while(cin >> a[0] >> a[1] >> a[2] && a[0]) {
    sort(a,a+3);
    double d=sqrt(a[0]*a[0]+a[1]*a[1]);
    int n;
    cin >> n;
    while(n--) {
      double x;
      cin >> x;
      x*=2;
      if(d<x) cout << "OK" << endl;
      else cout << "NA" << endl;
    }
  }
  return 0;
}
