#include<bits/stdc++.h>

using namespace std;

int inf = 2 * 1e9;

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> vp, vn;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a > 0)
      vp.push_back(a);
    else
      vn.push_back(-a);
  }
  sort(vp.rbegin(), vp.rend());
  sort(vn.rbegin(), vn.rend());
  int sp = vp.size(), sn = vn.size(), c = 0, p = 0, t = 0;
  char l = '.';
  string s;
  //cout << sp << " " << sn;
  while (sp + sn != 0) {
    int lp, ln;
    if (sp == 0)
      lp = inf;
    else
      lp = vp[sp - 1];
    if (sn == 0)
      ln = inf;
    else
      ln = vn[sn - 1];
    //cout << lp
    int cp = lp - t - p, cn = ln - t + p;
    if (cp <= 0 or cn <= 0)
      break;
    if (sp == 0) {
      if (l == '2')
        l = '3';
      else
        l = '2';
    } else if (sn == 0) {
      if (l == '1')
        l = '2';
      else
        l = '1';
    } else {
      if (l == '1')
        l = '2';
      else if (l == '2') {
        if (cp - cn >= 10)
          l = '3';
        else
          l = '1';
      } else if (cp <= cn)
        l = '1';
      else
        l = '2';
    }
    if (l == '1' and lp != inf) {
      c++;
      sp--;
      vp.pop_back();
    }
    if (l == '2' and ln != inf) {
      c++;
      sn--;
      vn.pop_back();
    }
    if (l == '3')
      p++;
    s += l;
    t++;
  }
  cout << c << "\n" << s;
  return 0;
}