#include<iostream>
#include<math.h>
using namespace std;

int main()
{
	int temp,c,i,f;
	double r,x,y,z;
	cin>>x>>y>>z;

	if(x>y){
		temp=x;
		x=y;
		y=temp;
	}
	if(y>z){
		temp=y;
		y=z;
		z=temp;
	}

	r=sqrt(pow(x/2,2)+pow(y/2,2));

	cout<<r;

	cin>>c;
	for(i=0;i<c;i++){
		cin>>f;
		if(r<=f)
			cout<<"OK\n";
		else cout<<"NA\n";
	}
}