#include<bits/stdc++.h>
using namespace std;
#define POW(u) ((u)*(u))
signed main(void){
	ios::sync_with_stdio(false);
	int a,b,c,n,x;
	while(cin>>a>>b>>c&&(a|b|c)){
		cin>>n;
		/*
		if(a>c)	swap(a,c);
		if(b>c)	swap(b,c);
		*/
		int v[3];
		v[0]=a,v[1]=b,v[2]=c;;
		sort(v,v+3);
		a=v[0],b=v[1];
		double MIN=POW((double)a/2.0)+POW((double)b/2.0);
		for(int i=1;i<=n;i++){
			cin>>x;
			if(POW(x)>MIN)
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}
}