#include <bits/stdc++.h>

using namespace std;

int main() {
	while (1) {
		double edges[3];
		cin >> edges[0] >> edges[1] >> edges[2];

		if (edges[0] == 0 && edges[1] == 0 && edges[2] == 0){ 
      break;
    }

    double p_c1 = pow(edges[1],2.0);
    double p_c2 = pow(edges[2],2.0);
    double cheese = p_c1 + p_c2;
    double c_cheese = sqrt(cheese);

		int n;
		cin >> n;
		
		for (int i = 0; i < n; i++) {
			double r;
			cin >> r;
      double s = r * 2.0;
		
      if(c_cheese < s){
			  cout<<"OK"<<endl;
      }
      else{
        cout<<"NA"<<endl;
      }
		}
	}
	return 0;
}
