#include <iostream>
using namespace std;
int main(){
  double x,y,t;
  int r;
  int n;
  while(1){
    cin >> x >> y >> t;
    if(x==0 && y==0 && t==0)break;
    cin >> n;
    for(int i=0;i<n;i++){
      cin >> r;
      if(x/2<r && y/2<r && t/2<r){
	cout << "OK" << endl;
      }
      else{
	cout << "NA" << endl;
      }
    }
  }
}