#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
#include <map>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<30;
const int EPS = 1e-8;

typedef pair<int, int> pii;

map<pii, double> mp;

double calc(int r1, int r2) {
  if (mp[pii(r1,r2)]) return mp[pii(r1,r2)];
  return mp[pii(r1,r2)] = sqrt((r1+r2)*(r1+r2) - (r1-r2)*(r1-r2));
}

int main() {
  string s;
  while(getline(cin, s)) {
    stringstream ss(s);
    double x;
    ss >> x;
    int r;
    vector<int> v;
    while(ss >> r) {
      v.push_back(r);
    }
    sort(ALL(v));
    int n = v.size();
    if (n == 0) {
      cout << "OK" << endl;
      continue;
    }
    deque<int> dq;
    REP(i,n/2) {
      if (i%2 == 0) {
        dq.push_front(v[i]);
        dq.push_back(v[n-i-1]);
      } else {
        dq.push_front(v[n-i-1]);
        dq.push_back(v[i]);
      }
    }
    if (n%2) {
      if (dq[n-2] + calc(dq[0],v[n/2]) < dq[0] + calc(dq[n-2], v[n/2]))
        dq.push_front(v[n/2]);
      else
        dq.push_back(v[n/2]);
    }
    FOR(it, dq) {
      cout << *it << " ";
    }
    cout << endl;

    double xx = dq[0] + dq[n-1];
    REP(i, n - 1) {
      xx += calc(dq[i], dq[i+1]);
    }
    if (xx <= x)
      cout << "OK";
    else
      cout << "NA";
    cout << endl;
  }
}