#include<iostream>
using namespace std;
int main(void){
	while( true ){
		int n;
		double x,y,z;
		
		cin >> x >> y >> z;
		if( x==0&&y==0&&z==0 ) break;
		cin >> n;

		for(int i = 0; i < n; i++){
			int r;
			cin >> r;
			if( (x*x/4)+(y*y/4) < r*r ||
				(x*x/4)+(z*z/4) < r*r ||
				(y*y/4)+(z*z/4) < r*r ) cout << "OK\n";
			else cout << "NA\n";
		}
	}
	return 0;
}