#include <stdio.h>
#include <stdlib.h>

void judge(int x, int y, int z, int r);

int main(void)
{
    int cheese_x, cheese_y, cheese_z;
    scanf("%d", &cheese_x);
    scanf("%d", &cheese_y);
    scanf("%d", &cheese_z);
    int n;
    int cnt;
    scanf("%d", &n);
    for(cnt = 0; cnt < n; cnt++){
        int hole_size;
        scanf("%d", &hole_size);
        judge(cheese_x, cheese_y, cheese_z, hole_size);
    }
    return 0;
}

void judge(int x, int y, int z, int r)
{
    int t = r * r;
    int d_1, d_2, d_3;
    d_1 = (x / 2) * (x / 2) + (y / 2) * (y / 2);
    d_2 = (y / 2) * (y / 2) + (z / 2) * (z / 2);
    d_3 = (z / 2) * (z / 2) + (x / 2) * (x / 2);
    if(d_1 < t || d_2 < t || d_3 < t){
        printf("OK\n");
    } else {
        printf("NA\n");
    }
}