#include <iostream>
#include <list>
using namespace std;

//0107
int main(){
	int a, b, c;
	int n, r;
	int first, second;
	list<int> el(0);

	while(cin >> a >> b >> c){
		if(a==0 && b==0 && c==0)break;
		el.push_back(a);
		el.push_back(b);
		el.push_back(c);
		el.sort();
		list<int>::iterator ite = el.begin();
		first = *ite++;
		second = *ite;

		cin >> n;
		while(n--){
			cin >> r;		

			//三平方の定理でチーズの対角線を求めて、
			//それが直径より大きいかで判定する
			if( (2*r)*(2*r) > (first*first)+(second*second)){
				cout << "OK" << endl;
			}else{
				cout << "NA" << endl;
			}
		}
	}

	return 0;
}