#include<stdio.h>

int main(){
  int a,b,c,r,i,n;
  double sa,sb,sc,sr;
  do{
    scanf("%d %d %d",&a,&b,&c);
    if(a==0&&b==0&&c==0) break;
    scanf("%d",&n);
    sa=(double)a/2.0;
    sb=(double)b/2.0;
    sc=(double)c/2.0;
    sa*=sa;
    sb*=sb;
    sc*=sc;
    for(i=0;i<n;i++){
      scanf("%d",&r);
      r=r*r;
      sr=(double)r;
      if(((sa+sb)<sr)||((sb+sc)<sr)||((sc+sa)<sr)){
	printf("OK\n");
      }else{
	printf("NA\n");
      }
    }
  }while(1);
  return 0;
}