#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>

#define PI 3.14159265359
#define R  1.41421356237

using namespace std;

int sq(int a){
return a*a;
}

int main(){
	double l[3],t;
	int m,n,c=0;
	int r[10000];

	cin >> l[0] >> l[1] >> l[2];
	cin >> n;

	//sort length
	sort(l,l+3);

	for(int i=0;i<n;i++){
		cin >> t;

		if(t==0){
			if(++c==3){
				break;
			}
		}

		/*cout << (sqrt(sq(t)-sq(l[0]/2))*2);
		cout << endl;
*/
		if((2*t > l[0]) && (sqrt(sq(t)-sq(l[0]/2))*2 > l[1])){
			r[i] = 1;
		}else{
			r[i] = 0;
		}
/*
		if(m<2*t*t){
			if((t*R>x&&t*R>y)||(t*R>x&&t*R>h)||(t*R>h&&t*R>y)){
				r[i] = 1;
			}else{
				r[i] = 0;
			}
		}else{
			r[i] = 0;
		}*/
	}


	for(int i=0;i<n;i++){
		if(r[i]==0){
			cout << "NA" << endl;
		}else{
			cout << "OK" << endl;
		}
	}

	return 0;
}