#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
using namespace std;
int main(){
	
	int l,w,h;
	int n;
	int r;
	while(cin>>l>>w>>h,l!=0&&w!=0&&h!=0){
		cin>>n;
		vector<int> r(n);
		for(int i=0;i<n;i++)
			cin>>r[i];
		for(int i=0;i<n;i++){
			if(l<2*r[i]&&w<2*r[i]&&h<2*r[i])
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}
}