#include <iostream>
using namespace std;

int main()
{
while(1){

    int a,b,c;
    cin>>a>>b>>c;
    if(a==0&&b==0&&c==0)break;
    int d;
    cin>>d;
    for(int e=0;e<d;e++){
    int f;
    cin>>f;

    if(f*2>b&&f*2>c){
            cout<<"OK\n";
    }
    else{
        cout<<"NA\n";
    }

    }
}

}