#define scanf_s scanf
//#define sscanf_s sscanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 1001
#define _MAX 100
#define HO 6
int main(void)
{
	while (1) {
		int d, w, h, n, r;
		scanf_s("%d %d %d", &d, &w, &h);
		if ((d == 0 && w == 0) && h == 0) break;
		scanf_s("%d", &n);
		for (int i = 0; i < n; ++i) {
			scanf_s("%d", &r);
			bool ny = false;
			if ((w < r * 2 && h < r* 2) && d < r * 2) {
				ny = true;
			}
			if (ny) 	printf("OK\n");
			else 	printf("NA\n");

		}
	}
}