#include<iostream>

using namespace std;


int main(){

  int a,b,c,r,qua;

  while(1){
    cin >> a >> b >> c;

    if(a == 0 && b == 0 && c == 0) break;

    cin >> qua;

    for(int i = 0; i < qua; i++){
      cin >> r;

      if(a < 2*r && b < 2*r && c < 2*r) cout << "OK"<<endl;
      else cout << "NA"<<endl;

    }


  }

  return 0;
}