#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main()
{
	while (1) 
	{
		vector<int>a(3);
		cin >> a[0] >> a[1] >> a[2];
		if (a[0] == 0 && a[1] == 0 && a[2] == 0)break;
		int b;
		cin >> b;
		for (int c = 0; c < b; c++) {
			int d;
			cin >> d;
			if (d*2> a[0] && d*2> a[1])cout << "OK" << endl;
			else cout << "NA" << endl;
		}
	}
}