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 True:
  lst = list(map(int, input().split()))
  if not lst[0]:
    break
  lst.sort()
  rad = (lst[0] ** 2 + lst[1] ** 2 ) ** (1 / 2) / 2  
  n = int(input())
  for _ in range(n):
    print("OK" if int(input()) > rad else "NA")

Python: import math

while True:
    d, w, h = [int(x) for x in input().split()]
    if d == w == h == 0:
        break
    dw = math.sqrt(d * d + w * w)
    dh = math.sqrt(d * d + h * h)
    wh = math.sqrt(w * w + h * h)
    min_ = min(dw, dh, wh)
    n = int(input())
    for i in range(n):
        r = int(input()) * 2
        if r > min_:
            print('OK')
        else:
            print('NA')

Python: while True:
    a=sorted(list(map(int,input().split())))
    if sum(a)==0:
        break
    s=min(a[0]**2+a[1]**2,a[1]**2+a[2]**2,a[0]**2+a[2]**2)
    n=int(input())
    for i in range(n):
        r=int(input())
        print("OK" if (r*2)**2>s else "NA")

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

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 int(input())-leng > 0:
			print('OK')
		else:
			print('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(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")

C++: #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

bool check(double x,double y,double z,double r){
	return sqrt(x*x+y*y) < r*2;
}

int main(){
	int data[3],r,n;
	while(cin >> data[0] >> data[1] >> data[2],data[0]){
		cin >> n;
		for(int i=0;i<n;i++){
			cin >> r;
			bool ret = false;
			sort(data,data+3);
			do{
				 ret |= check(data[0],data[1],data[2],r);
			}while(next_permutation(data,data+3));
			cout << (ret?"OK":"NA") << endl;
		}
	}
}

C++: #include "bits/stdc++.h"
using namespace std;

int main(){
	while(1){
		vector<int> x(3);
		cin>>x[0]>>x[1]>>x[2];
		if(x[0]==0&&x[1]==0&&x[2]==0)break;
		int n;
		cin>>n;
		sort(x.begin(),x.end());
		for(int i=0;i<n;i++){
			int r;
			cin>>r;
			r=sqrt(2)*r;
			if(r>x[1]){
				cout<<"OK"<<endl;
			}else{
				cout<<"NA"<<endl;
			}
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main(void)
{
  int i;
  double temp;
  double x[3];
  int y, z;
  int n;
  double t;

  for(i=0; i<3; i++)
    scanf("%lf", &x[i]);

  for(i=0; i<3; i++){
    if(x[i]>x[i+1]){
      temp=x[i];
      x[i]=x[i+1];
      x[i+1]=temp;
    }
  }

  t=x[0]*x[0]+x[1]*x[1];
  t=sqrt(t);
  
  scanf("%d", &n);
  
  for(i=0; i<n; i++){
    scanf("%d", &y);
    
    if(2*y>t)
      printf("OK\n");
    else
      printf("NA\n");
    
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define POW(u) ((u)*(u))
#define RAD(a,b) sqrt(POW((double)a/2.0)+POW((double)b/2.0))
signed main(void){
	ios::sync_with_stdio(false);
	int a,b,c,n,x;
	while(cin>>a>>b>>c&&(a|b|c)){
		cin>>n;
		if(a>c)	swap(a,c);
		if(b>c)	swap(b,c);
		for(int i=1;i<=n;i++){
			cin>>x;
			if(x>RAD(a,b))
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}
}

C++: #include<iostream>
#include<map>
using namespace std;

int main(){
    int a,b,c,n,r;
    while(cin>>a>>b>>c,a){
        cin>>n;
        while(n--){
            cin>>r;
            if(a*a+b*b<4*r*r||c*c+b*b<4*r*r||a*a+c*c<4*r*r)
                cout<<"OK"<<endl;
            else
                cout<<"NA"<<endl;
        }
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;


int main() {
	double n, r, a, b, c, d, e, f;
	while(1){
	cin >> a >> b >> c;
	if(a == 0 && b == 0 && c == 0) break;
	a *= a; b *= b; c *= c;
	d = sqrt(b + c) / 2;
	e = sqrt(a + c) / 2;
	f = sqrt(a + b) / 2;
	for(int i = 0;i < n;++i){
		cin >> r;
		if(d < r || e < r || f < r) cout << "OK" << endl;
		else cout << "NA" << endl;
	    }
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int st,si,he,n,r,low,mid;
  while(cin >> st >> si >> he&&st){
    cin >> n;
    low = min(st,min(si,he));
    if(st <= si && si <= he){
      mid = si;
    }
    else if(si <= st && st <= he){
      mid = st;
    }
    else{
      mid = he;
    }
    rep(i,n){
      cin >> r;
      if(low * low + mid * mid < r*r*4){
        cout << "OK"<<endl;
      }
      else{
        cout << "NA"<<endl;
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
	vector<int> a(3);
	while(cin>>a[0]>>a[1]>>a[2],a[0]||a[1]||a[2]){
		int n;
		cin>>n;
		sort(a.begin(),a.end());
		double t=(double)a[0]*a[0]+a[1]*a[1];
		// cout<<t<<endl;
		for(int i=0;i<n;i++){
			int r;
			cin>>r;
			if(4*r*r>t) cout<<"OK\n";
			else cout<<"NA\n";
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main(void)
{
  int i;
  double temp;
  double x[3];
  int y, z;
  int n;
  double t;

  while(1){
    for(i=0; i<3; i++)
      scanf("%d", &x[i]);
    if(x[0]==0 && x[1]==0 && x[2]==0)
      return 0;
      
    if(x[0]>x[1]){
      temp=x[0];
      x[0]=x[1];
      x[1]=x[0];
    }

    if(x[1]>x[2]){
      temp=x[1];
      x[1]=x[2];
      x[2]=x[1];
    }   
    if(x[0]>x[2]){
      temp=x[0];
      x[0]=x[2];
      x[2]=x[0];
    }
  
  t=x[0]*x[0]+x[1]*x[1];
  t=sqrt(t);
  
  scanf("%d", &n);
  
  for(i=0; i<n; i++){
    scanf("%d", &y);
    
    if(2*y>t)
      printf("OK\n");
    else
      printf("NA\n");
    
  }
  }
  return 0;
}