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: # -*- coding: utf-8 -*-

import sys
import os
import math

for s in sys.stdin:
    d, w, h = map(int, s.split())
    if d == w == h == 0:
        break

    lst = [d, w, h]
    lst.sort()
    diameter = math.sqrt(lst[0] ** 2 + lst[1] ** 2)

    n = int(input())

    for i in range(n):
        r = int(input())
        if 2 * r > diameter:
            print('OK')
        else:
            print('NA')

Python: import sys
for a in sys.stdin:
 if'0'==a:break
 s=list(map(int,input().split()))
 c=0
 while 1:
  t=s;s=[t.count(e)for e in t]
  if t==s:break
  c+=1
 print(c);print(*s)

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: # -*- coding: utf-8 -*-
 
import sys
import os
import math
 
for s in sys.stdin:
    d, w, h = map(int, s.split())
    if d == w == h == 0:
        break
 
    lst = [d, w, h]
    lst.sort()
    diameter = math.sqrt(lst[0] ** 2 + lst[1] ** 2)
 
    n = int(input())
 
    for i in range(n):
        r = int(input())
        if 2 * r > diameter:
            print('OK')
        else:
            print('NA')

Python: # Aizu Problem 0107: Carry a Cheese
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    a, b, c = sorted([int(_) for _ in input().split()])
    R = .5 * math.sqrt(a**2 + b**2)
    if a == b == c == 0:
        break
    N = int(input())
    for _ in range(N):
        r = int(input())
        print("OK" if r > R else "NA")

Python: import sys
for a in sys.stdin:
 if'0'in a:break
 if' 'in a:
  s=list(map(int,a.split()))
  c=0
  while 1:
   t=s;s=[t.count(e)for e in t]
   if t==s:break
   c+=1
  print(c);print(*s)

Python: t = []
temp = 0
while True:
        d,w,h = [int(s) for s in input().split(' ')]
        if d < w:
            temp = d
        else:
            temp = w
        if d == 0 and w == 0 and h == 0:
            break
        else:
            n = int(input())
            for i in range(n):
                t.append(i)
                t[i] = int(input())
                if (temp/2) ** 2 + (h/2) ** 2 < t[i] ** 2:
                    print("OK")
                else:
                    print("NA")

Python: def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

while True:
    d = [int(i) for i in input().split()]
    if d[0] == 0 and d[1] == 0 and d[2] == 0:
        break

    d.sort()
    cheese = d[0] * d[0] + d[1] * d[1]

    N = int(input())
    for l in range(N):
        R = int(input())*2
        if cheese < R*R:
            print("OK")
        else:
            print("NA")

Python: # AOJ 0107 Carry a Cheese
# Python3 2018.6.17 bal4u

while True:
	d, w, h = list(map(int, input().split()))
	if d == 0 and w == 0 and h == 0: break
	vmin = min(d*d+w*w, d*d+h*h, w*w+h*h)

	for _ in range(int(input())):
		r = int(input())
		print('OK' if (2*r)**2 > vmin else 'NA')

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(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(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: while 1:
    try:
        dwh=list(map(int,input().split()))
        if dwh[0]==dwh[1]==dwh[2]==0:break
        dwh.sort()
        std=(dwh[0]**2+dwh[1]**2)**0.5/2
        n=int(input())
        for i in range(n):
            r=int(input())
            if std<r:print("OK")
            else:print("NA")
    except:break

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Created    : 2015-05-12

l = map(int, input().split())
m = min(l)

for _ in range(int(input())):
    if int(input()) >= m:
        print("OK")
    else:
        print("NA")

Python: while True:
    Size_lis = list(map(int,input().split()))
    if Size_lis == [0,0,0]:
        break
    n = int(input())
    Size_lis.remove(max(Size_lis))
    m_r = (Size_lis[0] / 2) ** 2 + (Size_lis[1] / 2) ** 2

    for i in range(n):
        r = int(input())
        if m_r >= r ** 2:
            print("NA")
        else:
            print("OK")

Python: while True:
    d, w, h = map(int, input().split())
    if d == 0:
        break
    d = min(d**2 + w**2, w**2 + h**2, h**2 + d**2)
    n = int(input())
    for i in range(n):
        d_i = (int(input())*2)**2
        if d_i > d:
            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 2*int(input())-leng > 0:
			print('OK')
		else:
			print('NA')

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

Python: # AOJ 0107 Carry a Cheese
# Python3 2018.6.17 bal4u

while True:
	d, w, h = list(map(int, input().split()))
	if d == 0 and w == 0 and h == 0: break
	min = min(d*d+w*w, d*d+h*h, w*w+h*h)

	n = int(input())
	for i in range(n):
		r = int(input())
		print('OK' if (2*r)**2 > min else 'NA')

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

Python: # AOJ 0107 Carry a Cheese
# Python3 2018.6.17 bal4u

while True:
	d, w, h = list(map(int, input().split()))
	if d == 0 and w == 0 and h == 0:  break
	min = min(d*d+w*w, d*d+h*h, w*w+h*h)
	for _ in range(int(input())):
		r = int(input())
		print('OK' if min < (2*r)**2 else 'NA')

Python: import math

while True:
	l1, l2, l3 = sorted(list(int(i) for i in input().split()))
	if l1 == l2 == l3 == 0:
		break
	n = int(input())
	R = math.sqrt(l1 ** 2 + l2 ** 2) / 2
	for i in range(n):
		r = int(input())
		if r > R:
			print('OK')
		else:
			print('NA')

Python: #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from math import hypot


def main(readline=stdin.readline):
    answer = ('NA', 'OK')

    while 1:
        height, width, depth = (float(s) for s in readline().split())
        if not height:
            exit()

        hw = hypot(height, width)
        wd = hypot(width, depth)
        dh = hypot(depth, height)

        for _ in range(int(readline())):
            size = float(int(readline()) * 2)
            print(answer[size > hw or size > wd or size > dh])


if __name__ == '__main__':
    main()

Python: while True:
    try:
        d, w, h = list(map(int, input().split()))
        if d == w == h == 0:
            break
        n = int(input())
        r = []
        for i in range(n):
            r = int(input())
            if r ** 2 > (d ** 2 + w ** 2) / 4 \
                or r ** 2 > (d ** 2 + h ** 2) / 4 \
                or r ** 2 > (h ** 2 + w ** 2) / 4 :
                print("OK")
            else:
                print("NA")
    except EOFError:
        break