#include <iostream>
#include <cmath>
#include <algorithm>
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(void){
	long int a[3],n;
	long double d;
	cin >> a[0] >> a[1] >> a[2];
	d = sqrt((double)a[0]*a[0]+(double)a[1]*a[1])/2;
	sort(a,a+3);
	cin >> n;
	REP(i,n){
		long int r;
		cin >> r;
		if (r>d)
			cout << "OK" << endl;
		else
			cout << "NA" << endl;
	}

	cin >> d >> d >> d;


	return 0;
}