#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int N;
    cin >> N;

    vector<int> sever, jug;

    for (int i = 0; i < N; 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());

    int iS = 0, iJ = 0;
    int vreme = 0;
    int prethodni = 0;
    string potezi;

    while (vreme < 1000000) {

        bool mozeSever = (iS < (int)sever.size() && sever[iS] > vreme);
        bool mozeJug   = (iJ < (int)jug.size()   && jug[iJ] > vreme);

        if (!mozeSever && !mozeJug) break;

        int potez;

        if (mozeSever && prethodni != 1 &&
            (!mozeJug || sever[iS] <= jug[iJ])) {
            potez = 1;
            iS++;
        }
        else if (mozeJug && prethodni != 2) {
            potez = 2;
            iJ++;
        }
        else {
            if (prethodni == 1) potez = 2;
            else potez = 1;
        }

        potezi.push_back('0' + potez);
        prethodni = potez;
        vreme++;
    }

    cout << iS + iJ << "\n";
    cout << potezi << "\n";

    return 0;
}