#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	while (1) {

		vector<ld>ls(3);
		cin >> ls[0] >> ls[1] >> ls[2];
		sort(ls.begin(), ls.end());
		ld r = sqrt(ls[0] * ls[0] + ls[1] * ls[1]);
		if (abs(ls[0])<eps)break;
		int d; cin >> d;
		while (d--) {
			int n; cin >> n;
			if (ld(n*2) > r + eps)cout << "OK" << endl;
			else cout << "NO" << endl;
		}
	}
	return 0;
}