#include <iostream>
#include <stdio.h>

#define PI 3.14159265359
#define R  1.41421356237

using namespace std;

int main(){
	int x,y,h;
	int m,n,c=0;
	int r[10000];
	float t;

	cin >> x >> y >> h >> n;

	//detect most small surface
	m = x*y;
	if(m>x*h)m = x*h;
	if(m>y*h)m = y*h;

	for(int i=0;i<n;i++){
		cin >> t;

		if(t==0){
			if(++c==3){
				break;
			}
		}

		if(m<2*t*t){
			if((t*R>x&&t*R>y)||(t*R>x&&t*R>h)||(t*R>h&&t*R>y)){
				r[i] = 1;
			}else{
				r[i] = 0;
			}
		}else{
			r[i] = 0;
		}
	}


	for(int i=0;i<n;i++){
		if(r[i]==0){
			cout << "NA" << endl;
		}else{
			cout << "OK" << endl;
		}
	}

	return 0;
}