#include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;

int main(){
	stringstream buf;
	int a,b,c,n;
	scanf("%d %d %d %d",&a,&b,&c,&n);
	vector<int> args;
	args.push_back(a);
	args.push_back(b);
	args.push_back(c);
	sort(args.begin(),args.end());
	double d = sqrt(args[0]*args[0]+args[1]*args[1]);
	for(int x=0;x<n;++x){
		int r;
		scanf("%d",&r);
		double l = sqrt(2)*r;
		if(d<2*r){
			buf<<"OK\n";
		}else{
			buf<<"NA\n";
		}
	}
	scanf("%d %d %d",&a,&b,&c);
	cout<<buf.str();
	return 0;
}