Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		line := strings.Split(stdin.Text(), " ")
		len := []int{}
		for i := 0; i < 3; i++ {
			tmp, _ := strconv.Atoi(line[i])
			len = append(len, tmp)
		}
		if len[0] == 0 && len[1] == 0 && len[2] == 0 {
			break
		}
		sort.Ints(len)
		d2 := len[0]*len[0] + len[1]*len[1]
		stdin.Scan()
		n, _ := strconv.Atoi(stdin.Text())
		for i := 0; i < n; i++ {
			stdin.Scan()
			r, _ := strconv.Atoi(stdin.Text())
			if 4*r*r > d2 {
				fmt.Println("OK")
			} else {
				fmt.Println("NA")
			}
		}
	}
}

Python: while 1:
 a,b,_=sorted(map(int,input().split()))
 if a==0:break
 for _ in[0]*int(input()):print("OK"if(int(input())*2)**2>a*a+b*b else"NA")

Python: import itertools

def ch(l,r):
    t=itertools.combinations(l,2)
    for i in t:
        if i[0]**2+i[1]**2<4*r**2:
            return True
    return False

l=list(map(int,input().split()))
o=[ch(l,int(input())) for i in range(int(input()))] 
input()
[print("OK") if i else print("NA") for i in o]

Python: import sys,itertools

def ch(l,r):
    t=itertools.combinations(l,2)
    for i in t:
        if i[0]**2+i[1]**2<4*r**2:
            return True
    return False

l=list(map(int,input().split()))
o=[ch(l,int(input())) for i in range(int(input()))] 
input()
[print("OK") if i else print("NA") for i in o]

Python: while 1:
    cheese=list(map(int,input().split()))
    if cheese[0]==0:break
    n=int(input())
    cheese=sorted(cheese)
    for i in range(n):
        radius = int(input())
        if radius*2>(cheese[0]**2+cheese[1]**2)**0.5:print("OK")
        else:print("NA")

Python: # coding=utf-8

###
### for python program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    def pnum_check(self, n):
        if (n==1):
            return False
        elif (n==2):
            return True
        else:
            for x in range(2,n):
                if(n % x==0):
                    return False
            return True

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")

def printA(A):
    N = len(A)
    for i, n in enumerate(A):
        print(n, end='')
        if i != N-1:
            print(' ', end='')
    print()

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

while True:
    D, W, H = [int(x) for x in input().split()]
    if D==0 and W==0 and H==0:
        break
    N = int(input())

    for i in range(N):
        r = int(input())
        r1 = (D*D+W*W)**(1/2)/2
        r2 = (W*W+H*H)**(1/2)/2
        r3 = (H*H+D*D)**(1/2)/2
        rm = min([r1,r2,r3])
        if r > rm:
            print('OK')
        else:
            print('NA')

Python: import math
while True:
	d,w,h = map(int,input().split())
	if d == 0:
		break
	n = int(input())
	dist = [d**2+w**2, d**2+h**2, w**2+h**2]
	leng = min(dist)
	for i in range(n):
		if leng-int(input()) > 0:
			print('OK')
		else:
			print('NA')

Python: import itertools

def ch(l,r):
    t=itertools.combinations(l,2)
    for i in t:
        if i[0]**2+i[1]**2<4*r**2:
            return True
    return False

while 1:
    l=list(map(int,input().split()))
    if l[0]==0 and l[1]==0 and l[2]==0:break
    o=[ch(l,int(input())) for i in range(int(input()))] 
    [print("OK") if i else print("NA") for i in o]

Python: def min_diag(A,B,C):
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(int,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = int(input())

  # process
  min_diag = min_diag(A,B,C)

  # judge & output
  for r in R:
    if min_diag < 2*r:
      print("OK")
    else:
      print("NA")

Python: import math
while True:
	d,w,h = map(int,input().split())
	if d == 0:
		break
	n = int(input())
	dist = [math.sqrt(d**2+w**2), math.sqrt(d**2+h**2), math.sqrt(w**2+h**2)]
	leng = min(dist)
	for i in range(n):
		if int(input())-leng > 0:
			print('OK')
		else:
			print('NA')

Python: while 1:
    a,b,_=sorted(map(int,input().split()))
    if a==0:break
    c=(a**2+b**2)**0.5//2
    for _ in range(int(input())):print('OK' if c<int(input()) else 'NA')

Python: # -*- coding: utf-8 -*-
"""
"""
import sys


def solve(d, w, h, holes):
    result = []
    diagonal_len = (w**2 + h**2)**0.5
    for r in holes:
        if r*2 > diagonal_len:
            result.append('OK')
        else:
            result.append('NA')
    # ???????????\????????£?????¢???1????????????: ????????????r x 2**0.5
    #for r in holes:
    #    side_max = max(w, h)
    #    if r*2**0.5 >= side_max:
    #       result.append('OK')
    #    else:
    #        result.append('NA')
    return result


def main(args):
    while True:
        #d, w, h = 10, 6, 8
        #holes = [4, 8, 6, 2, 5]
        d, w, h = [int(x) for x in input().strip().split(' ')]
        if d == 0 and w == 0 and h == 0:
            break
        num = int(input())
        holes = [int(input().strip()) for _ in range(num)]
        result = solve(d, w, h, holes)
        for r in result:
            print(r)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: import math

if __name__ == '__main__':
    
    while True:
        d,w,h = map(int,input().split())
        if d == 0 and w == 0 and h == 0:
            break
    
        a1 = math.sqrt(d*d + h*h)
        a2 = math.sqrt(d*d + w*w)
        a3 = math.sqrt(h*h + w*w)
        n = int(input())

        for _ in range(n):
            c = int(input())
            if c*2 <= a1 and c*2 <= a2 and c*2 <= a3:
                print("NA")
            else:
                print("OK")