while 1:

  a,b,c=sorted(map(int,input().split()))

  if a==b==c==0: break

  D=(a*a+b*b)**.5

  for _ in [0]*eval(input()): print(["NA","OK"][2*eval(input())>D])
while 1:

  a,b,c=sorted(map(int,input().split()))

  if a==b==c==0: break

  D=a*a+b*b

  n=eval(input())

  for _ in [0]*n:

    r=eval(input())

    print(["NA","OK"][4*r**2>D])
while 1:
    a, b, c = sorted(map(int, input().split()))
    if a == b == c == 0:
        break
    D = (a * a + b * b) ** 0.5
    for _ in [0] * eval(input()):
        print(["NA", "OK"][2 * eval(input()) > D])

while 1:
    a, b, c = sorted(map(int, input().split()))
    if a == b == c == 0:
        break
    D = a * a + b * b
    n = eval(input())
    for _ in [0] * n:
        r = eval(input())
        print(["NA", "OK"][4 * r**2 > D])

-    D = (a * a + b * b) ** 0.5 -    for _ in [0] * eval(input()): -        print(["NA", "OK"][2 * eval(input()) > D]) +    D = a * a + b * b +    n = eval(input()) +    for _ in [0] * n: +        r = eval(input()) +        print(["NA", "OK"][4 * r**2 > D])