#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX 1e7
int main(){
    ll d,w,h;
    while(cin >> d >> w >> h,d+w+h){
        int n; cin>>n;
        vi v (n+1,0);
        double pi = acos(-1.0);
        ll s = w*h;
        rep(i,n){
            cin >>v[i];
            double temp = v[i]*v[i]*pi;
            int r = 2*v[i];
            //cout << "temp : " << temp << "s :" << s << endl;
            if( d<r && w<r && h<r  && temp>s)
                cout << "OK" << endl;
            else
                cout << "NA" << endl;
            }
        }
    return 0;
}