#include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;

void sorting(int *a,int *b,int *c){
	vector<int> args;
	args.push_back(*a);
	args.push_back(*b);
	args.push_back(*c);
	sort(args.begin(),args.end());
	*a = args[0];
	*b = args[1];
	*c = args[2];
}

int main(){
	stringstream buf;
	int a,b,c;
	string line;
	getline(cin,line);
	sscanf(line.c_str(),"%d %d %d",&a,&b,&c);
	sorting(&a,&b,&c);
	getline(cin,line);
	getline(cin,line);
	while(line!="0 0 0"){
		int n;
		sscanf(line.c_str(),"%d",&n);
		double l = sqrt(2)*n;
		if(l>a && l>b){
			buf<<"OK\n";
		}else{
			buf<<"NA\n";
		}
		getline(cin,line);
	}
	cout<<buf.str();
	return 0;
}