#include <bits/stdc++.h>

using namespace std;

int main() {
    int nep; cin >> nep;
    vector<int> jug;
    vector<int> sever;
    for (int i = 0; i < nep; i++) {
        int x; cin >> x;
        if (x > 0) sever.push_back(x);
        else jug.push_back(-x);
    }
    sort(sever.begin(), sever.end());
    sort(jug.begin(), jug.end());
    vector<int> potezi;
    int i = 0, j = 0, hpoz = 0, pretpot = 0, killed = 0, potez = 0;
    while (true) {
        if (jug[i] < sever[j]) {
            if (pretpot != 2) {
                potezi.push_back(2);
                killed--;
                pretpot = 2;
                i++;
                for (int k = i; k < jug.size(); k++) jug[k]--;
                for (int k = j; k < sever.size(); k++) sever[k]--;
            }
            else {
                potezi.push_back(1);
                pretpot = 1;
                for (int k = i; k < jug.size(); k++) jug[k]--;
                for (int k = j; k < sever.size(); k++) sever[k]--;
            }
        }
        else if (sever[j] <= jug[i] and pretpot != 1) {
            potezi.push_back(1);
            killed--;
            pretpot = 1;
            j++;
            for (int k = i; k < jug.size(); k++) jug[k]--;
            for (int k = j; k < sever.size(); k++) sever[k]--;
        }
        potez++;

    }
    cout << killed << endl;
    for (int i = 0; i < potez; i++) cout << potezi[i];
}