# include <iostream>
# include <sstream>
# include <string>
# include <cmath>
# include <algorithm>
const int MAX_N = 12;
const double INF = (1 << 20);

int n, l;
int r[MAX_N];
double memo[1 << MAX_N][MAX_N];

double solve(int s, int v) {
	if (s == (1 << n) - 1)
		return r[v];
	if (memo[s][v] >= 0)
		return memo[s][v];
	double res = INF;
	for (int i = 0; i < n; ++i) {
		if ((s >> i & 1) == 0)
			res = std::min(res, solve(s | (1 << i), i) + sqrt(pow(r[i] + r[v], 2) - pow(r[i] - r[v], 2)));
	}
	return memo[s][v] = res;
}

int main() {
	while (1) {
		if (std::cin.eof())
			break;
		n = 0;
		std::string str;
		std::getline(std::cin, str);
		std::stringstream s(str);
		s >> l;
		s.ignore();
		while (!s.eof()) {
			int a;
			s >> a;
			r[n] = a;
			++n;
			s.ignore();
		}
		for (int i = 0; i < (1 << n); ++i) {
			for (int j = 0; j < n; ++j)
				memo[i][j] = -1;
		}
		double ans = INF;
		for (int i = 0; i < n; ++i) {
			ans = std::min(ans, solve((1 << i), i) + r[i]);
		}
		std::cout << ans << std::endl;
		if (ans <= (double)l)
			std::cout << "OK" << std::endl;
		else
			std::cout << "NA" << std::endl;
	}
	return 0;
}