#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;

int main()
{
	int x, y, z, ins, i;
	int *input;
	cin >> x >> y >> z;
	cin >> ins;
	input = new int[ins]();
	for(i = 0; i<ins+1; i++)
		cin >> input[i];
	for(i = 0; i<ins; i++)
	{
		if(input[i]*2 < sqrt(x*x+y*y))
		{
			cout << "NA" << endl;
		}
		else
			cout << "OK" << endl;
	}
}