#include <bits/stdc++.h>

#define int int64_t

signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  int n;
  std::cin >> n;
  std::vector<int> x(n + 1);
  std::set<int> s1, s2;
  for(int i = 1; i <= n; i++) {
    std::cin >> x[i];
    if(x[i] < 0) {
      s1.insert(-x[i]);
    }
    else {
      s2.insert(x[i]);
    }
  }
  std::sort(x.begin() + 1, x.end());
  int t = 1e6;
  int pos = 0;
  int ans = 0;
  int h = 0;
  int p = 0;
  std::vector<int> X;
  if(s1.size() && s2.size()) {
    int prvl = *s1.begin();
    int prvr = *s2.begin();
    if(prvl != 1 && prvr == 1) {
      X.push_back(2);
      ans += 1;
      s2.erase(prvr);
    }
  }
  while(t--) {
    if(!s1.size()) {
      if(!p) {
        p ^= 1;
        h += 1;
        X.push_back(1);
      }
      else {
        int prv = *s2.begin();
        if(prv - h > pos) {
          s2.erase(prv);
          ans += 1;
          h += 1;
          X.push_back(2);
          p ^= 1;
        }
        else {
          break;
        }
      }
      continue;
    }
    if(!s2.size()) {
      if(!p) {
        int prev = *s1.begin();
        if(prev - h > pos) {
          ans += 1;
          s1.erase(prev);
          h += 1;
          p ^= 1;
          X.push_back(1);
        }
        else {
          break;
        }
      }
      else {
        X.push_back(3);
        pos -= 1;
        p ^= 1;
      }
      continue;
    }
    if(!p) {
      int prev = *s1.begin();
      if(prev - h > pos) {
        s1.erase(prev);
        ans += 1;
        h += 1;
        X.push_back(1);
        p ^= 1;
      }
      else {
        break;
      }
    }
    else {
      int prev = *s2.begin();
      if(prev - h > pos) {
        X.push_back(2);
        s2.erase(prev);
        ans += 1;
        h += 1;
        p ^= 1;
      }
      else {
        break;
      }
    }
  }
  std::cout << ans << "\n";
  for(auto x : X) {
    std::cout << x;
  }
}