#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


const string NA = "NA";
const string OK = "OK";

double sq( double x ) {
    return x * x;
}

string solve( int r, int R[3] ) {
    for ( int i = 0; i < 3; ++ i ) {
        for ( int j = i + 1; j < 3; ++ j ) {
            if ( sqrt( sq( R[i] ) + sq( R[j] ) ) < 2 * r ) return OK;
        }
    }
    return NA;
}

int main() {
    int x, y, z;
    while ( cin >> x >> y >> z ) {
        if ( x == 0 && y == 0 && z == 0 ) break;
        int R[3] = { x, y, z };
        int n;
        cin >> n;
        for ( int i = 0; i < n; ++ i ) {
            int r;
            cin >> r;
            cout << solve( r, R ) << endl;
        }
    }
    return 0;
}