#include<iostream>
#include<cmath>

using namespace std;

int main() {
	
	int a, b, c;
	
	while( cin >> a >> b >> c) {
		
		if( a == b && b == c && c == 0)
			break;
			
		double d[4] = {};
		
		d[0] = sqrt(a * a + b * b) / 2;
		d[1] = sqrt(a * a + c * c) / 2;
		d[2] = sqrt(b * b + c * c) / 2;
		
		d[4] = min(d[0], min(d[1], d[2]));
		
		int n;
		cin >> n;
		
		for(int i=0;i<n;i++) {
			
			int r;
			cin >> r;
			
			if(r > d[4])
				cout << "OK\n";
			
			else
				cout << "NA\n";
			
		}
		
		
	}
	
	return 0;
}

