#include <bits/stdc++.h>

using namespace std;

string ans[11000];

int main(void) {
    int v[3], n, r;
    double w, h, l;
    
    while (scanf("%d %d %d", &v[0], &v[1], &v[2]), v[0]) {
        sort(v, v + 3);
        w = v[0] / 2.0;
        h = v[1] / 2.0;
        l = sqrt(w * w + h * h);
        scanf("%d", &n);

        for (int i = 0; i < n; i++) {
            scanf("%d", &r);
            if ((double)r > l) ans[i] = "OK";
            else ans[i] = "NA";
        }
        
        for (int i = 0; i < n; i++)
            cout << ans[i] << endl;
    }

    return 0;
}
