#include <iostream>

using namespace std;

void solve()
{
	int length, width, height;
	while(cin >> length >> width >> height)
	{
		if(!length && !width && !height)
		{
			break;
		}
		int max = length;
		if(max < width)
		{
			max = width;
		}
		if(max < height)
		{
			max = height;
		}
		max /= 2;
		int n;
		cin >> n;
		while(n--)
		{
			int size;
			cin >> size;
			if(max < size)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NA" << endl;
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}