#include <bits/stdc++.h>
using namespace std;

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

    int n;
    cin >> n;

    vector<long long> levo, desno;
    for (int i = 0; i < n; i++) {
        long long x;
        cin >> x;
        if (x < 0) levo.push_back(-x);
        else desno.push_back(x);
    }

    sort(levo.begin(), levo.end());
    sort(desno.begin(), desno.end());

    int i = 0, j = 0;
    int zadnjiPotez= -1;
    long long t = 0;
    string potezi;
    int ubijenih = 0;

    while (true) {
        long long dl = (i < (int)levo.size() ? levo[i] : LLONG_MAX);
        long long dr = (j < (int)desno.size() ? desno[j] : LLONG_MAX);

        if (min(dl, dr) <= t) break;

        int move;
        if (dl <= dr) move = 2;
        else move = 1;

        if (move == zadnjiPotez) {
            potezi.push_back('3');
            zadnjiPotez = 3;
            t++;
            continue;
        }

        potezi.push_back(char('0' + move));
        zadnjiPotez = move;
        t++;
        ubijenih++;

        if (move == 2) i++;
        else j++;
    }

    cout << ubijenih << "\n";
    cout << potezi << "\n";
    return 0;
}