#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    long long a, b, c, chk;


    while (cin >> a >> b >> c, a || b || c) {
        chk = min(a * a + b * b, min(b * b + c * c, a * a + c * c));

        int n;        
        cin >> n;
        while (n--) {
            long long r;

            cin >> r;
            if ((2 * r) * (2 * r) >= chk)
                cout << "OK" << endl;
            else
                cout << "NA" << endl;
        }
    }
    
    return 0;
}