//40
#include<iostream>
#include<algorithm>

#define S(X) ((X)*(X))

using namespace std;

int main(){
  for(int l[3];cin>>l[0]>>l[1]>>l[2],l[0]|l[1]|l[2];){
    sort(l,l+3);
    int n;
    cin>>n;
    while(n--){
      int r;
      cin>>r;
      cout<<((S(l[0])+S(l[1])<S(2*r))?"OK":"NA")<<endl;
    }
  }
  return 0;
}