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")
			}
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

typedef long double Real;
#define EPS 1e-13
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

#define MP make_pair<int,int>

int main(){
  while(true){
    int a,b,c;
    cin>>a>>b>>c;
    if(!a)break;
    if(a>b)swap(a,b);
    if(b>c)swap(b,c);
    int x = sqrt(a*a+b*b)/2+1;
    int n;
    cin>>n;
    while(n--){
      int r;
      cin>>r;
      if(r>=x)cout<<"OK"<<endl;
      else cout<<"NA"<<endl;
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define EPS (1e-8)

int main() {
	int a, b, c, n;
	while (cin >> a >> b >> c, a || b || c) {
		cin >> n;
		int min1 = min(a, b), min2 = min(max(a, b), c);
		double d = hypot(min1, min2) / 2.0;
		cout << d << endl;
		REP(i, n) {
			double r;
			scanf("%lf", &r);
			if (r - d > EPS) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}

C++: #include <cstdio>
int a,b,c,n,r;
int main()
{
    while(scanf("%d%d%d",&a,&b,&c),(a|b|c)) {
        a*=a;b*=b;c*=c;
        scanf("%d",&n);
        while(n--){
            scanf("%d",&r);
            r*=4*r;
            puts((a+b<r||b+c<r||c+a<r)?"OK":"NA");
        }
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;
inline int toInt(string s){int v;istringstream i(s);i>>v;return v;}
template<class T> inline string toString(T x){ostringstream o;o<<x;return o.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

inline int POW(int x) {
	return x * x;
}

int main() {
	for(int h, w, d; cin >> h >> w >> d, h || w || d;) {
		int a[] = {h, w, d};
		sort(a, a + 3);
		double len = sqrt(POW(a[0]) + POW(a[1]));
		
		int N; cin >> N;
		for(int i = 0; i < N; i++) {
			int L = 0; cin >> L;

			if (len < 2 * L - EPS) {
				cout << "OK" << endl;
			} else {
				cout << "NA" << endl;
			}
		}
	}

	return 0;
}

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

int main() {
  int n;

  while(1) {
    vector<float> che(3, 0);
    cin >> che[0] >> che[1] >> che[2];
    if(che[0] == 0.0 && che[1] == 0.0 && che[2] == 0.0) break;
    cin >> n;

    sort(che.begin(), che.end());

    int r[10000] = {0};
    for(int i = 0; i < n; i++) {
      cin >> r[i];
      if((r[i]*r[i]*4) > ((che[0]*che[0])+(che[1]*che[1])))
        cout <<	"OK" <<	endl;
      else
        cout <<	"NA" <<	endl;
    }
    che.clear();
  }
  return 0;
}

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

#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)

int r;
bool ok(int a, int b) {
	double c = pow(a, 2.0) + pow(b, 2.0);
	if(c < pow(r * 2, 2.0)) return true;
	else return false;
}
int main() {
	int n, m, k, s;
	while(cin >> n >> m >> k && (n || m || k)) {
		cin >> s;
		rep(i,s) {
			cin >> r;
			if(ok(n, m) || ok(m, k) || ok(k, n)) {
				cout << "OK" << endl;
			} else cout << "NA" << endl;
		}
	}
	return 0;
}

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

int main() {
  long long int a,b,c,n,r;
  while(cin >> a >> b >> c) {
    if((a==0)&&(b==0)&&(c==0)) break;
    cin >> n;
    for(int i=0;i<n;i++) {
      cin >> r;
      if((a*a + b*b < 4*r*r) || (b*b + c*c < 4*r*r) || (c*c + a*a < 4*r*r)) {
        cout << "OK" << endl;
      }
      else
        cout << "NA" << endl;
    }
  }
  return 0;
}