#include <algorithm>
#include <iostream>
#include <list>
#include <cctype>
#include <string>
#include <vector>
using namespace std;

double index(char c){
	return (double)((int)c - '0');
}

vector<string> split(string &s){
	vector<string> vs;
	string::iterator i = s.begin(), j;
	while(i != s.end()){
		j = i;
		while(j != s.end() && !isspace(*j)) j++;
		string t(i, j);
		vs.push_back(t);
		i = j;
		while(i != s.end() && isspace(*i)) i++;
	}
	return vs;
}

double get_num(const string &s){
	int n = 1;
	double num = 0.0;
	for(string::const_reverse_iterator cri = s.rbegin();
		cri != s.rend(); cri++)
	{
		num += n * index(*cri);
		n = n * 10;
	}
	return num;
}

double gap(double x, double y){
	return (y - x) * (y - x);
}

void swap(vector<double> &vd, int i , int j){
	double t = vd[i];
	vd[i] = vd[j];
	vd[j] = t;
}

double sqrt(double x){
	double e = 0.00000001;
	double a = x, b = 0;
	while(a - b > e){
		double c = (a + b) / 2;
		if(c * c < x) b = c;
		else a = c;
	}
	return b;
}

int main(){
	int length;
	string s;
	while(getline(cin, s)){
		vector<string> vs;
		list<double> cakes;
		vs = split(s);
		vector<double> vd;
		double length = get_num(vs[0]);
		for(int i = 1; i < vs.size(); i++){
			vd.push_back(get_num(vs[i]));
		}
		cakes.push_back(vd[vd.size() - 1]);
		vd.pop_back();
		int n = vd.size();
		for(int i = 0; i < n; i++){
			double mcake = 0;
			int p = 1;
			int jmax = 0;
			for(int j = 0; j < vd.size(); j++){
				if(gap(*(cakes.begin()), vd[j]) > mcake){
					mcake = gap(*(cakes.begin()), vd[j]);
					jmax = j;
					p = 1;
				}
				if(gap(*(cakes.rbegin()), vd[j]) > mcake){
					mcake = gap(*(cakes.rbegin()), vd[j]);
					jmax = j;
					p = 0;
				}
			}
			if(p){
				cakes.push_front(vd[jmax]);
				swap(vd, jmax, vd.size()-1);
				vd.pop_back();
			}else{
				cakes.push_back(vd[jmax]);
				swap(vd, jmax, vd.size() - 1);
				vd.pop_back();
			}
		}
		for(list<double>::iterator iter = cakes.begin(); 
			iter != cakes.end(); iter++)
			vd.push_back(*iter);
		double size = 0;
		for(int i = 0; i+1 < vd.size(); i++){
			cout << size << endl;
			size += sqrt((vd[i] + vd[i+1]) * (vd[i] + vd[i+1]) - gap(vd[i],vd[i+1]));
		}
		size += vd[0]+vd[vd.size()-1];
		if(size <= length) cout << "OK" << endl;
		else cout << "NA" << endl;
	}
	return 0;
}