#include <iostream>
using namespace std;
int main(void){
    int d,w,h,x,n;
    while(cin>>d>>w>>h,d||w||h){
        cin>>n;
        for(int i=0;i<n;i++){
            cin>>x;
            x=x*2;
            if(d<x&&w<x&&h<x){
                cout<<"OK"<<endl;
            }else{
                cout<<"NA"<<endl;
            }
        }
    }
    return 0;
}