#include<iostream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

const int MAX_N = 50;

int main(){
	double x, y, z, n;
	vector< pair<double, double> > h;
	vector< pair<double, double> > c;
	cin >>x >>y >>z;
	
	double temp = sqrt( x * x + y * y );
	c.push_back( make_pair(temp, temp) );
	temp = sqrt( z * z + y * y );
	c.push_back( make_pair(temp, temp) );
	temp = sqrt( z * z + x * x );
	c.push_back( make_pair(temp, temp) );
	
	cin >>n;
	for(int i = 0; i < n; i++){
		double tmp;
		cin >>tmp;
		h.push_back( make_pair(tmp * 2, tmp * 2) );
	}
	
	bool okflag = false;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 3; j++){
			if(h[i].first > c[j].first && h[i].second > c[j].second){
				okflag = true;
				cout <<"OK" <<endl;
				break;
			}
		}
		if(okflag == false) cout <<"NA" <<endl;
		okflag = false;
	}
	
	return 0;
}