
#include<iostream>
using namespace std;
int main(){
double w,h,d,r;
double pi=3.141592653,s;

int n;
while(1){
cin >> w >> h >> d;
if(w+h+d==0) break;
cin >> n;
while(n--){
cin >> r;
s=r*r*pi;
if(w*h<s||h*d<s||d*w<r) cout<<"OK" << endl;
else cout << "NA" << endl;
}
}
return 0;
}