#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int d, w, h;
  while (cin >> d >> w >> h, d) {
    if (d < w) swap(d, w);
    if (w < h) swap(w, h);
    if (d < w) swap(d, w);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      int r;
      cin >> r;
      cout << (w * w + h * h < 4 * r * r ? "OK" : "NA") << endl;
    }
  }

  return 0;
}
