#include <cstdio>
#include <cmath>
#include <iostream>

double CalcGr(int x,int  y);

class Cheese{
public:
	int x;
	int y;
	int z;
	double gr[3];
	Cheese(){
//		scanf("%d %d %d", &x, &y, &z);
		std::cin >> x >> y >> z;
		gr[0] = CalcGr(x, z);
		gr[1] = CalcGr(x, y);
		gr[2] = CalcGr(y, z);
	}
};

int main(){
	Cheese c;
	
	int n;
//	scanf("%d", &n);
	std::cin >> n;

	int r;
	for (int i = 0; i < n; i++){
//		scanf("%d", &r);
		std::cin >> r;
		if (c.gr[0] < r || c.gr[1] < r || c.gr[2] < r){
			printf("OK\n");
		}
		else{
			printf("NA\n");
		}
	}
}

double CalcGr(int x, int y){
	return sqrt((double)(x*x + y*y)) / 2;
}