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

int main()
{
    iostream::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;
    vector<int> dementori(n);
    vector<int> plusdem, minusdem;
    for (int i = 0; i < n; i++) {
        cin >> dementori[i];
        if (dementori[i] > 0) plusdem.push_back(dementori[i]);
        else minusdem.push_back(dementori[i]);
    }

    sort(plusdem.rbegin(), plusdem.rend());
    sort(minusdem.begin(), minusdem.end());

    string log = "";
    int mrtvi = 0;
    while((!plusdem.empty() && !minusdem.empty()) && minusdem[minusdem.size() - 1] != 0 && plusdem[plusdem.size() - 1] != 0) {
        if (abs(plusdem[plusdem.size() - 1]) <= abs(minusdem[minusdem.size() - 1]) && log[log.size() - 1] != '1') {
            log += "1";
            plusdem.pop_back();
            mrtvi += 1;
        }
        else {
            log += "2";
            minusdem.pop_back();
            mrtvi += 1;
        }
        for (int i = 0; i < plusdem.size(); i++) plusdem[i]++;
        for (int i = 0; i < minusdem.size(); i++) minusdem[i]++;
    }


    if (plusdem.empty() && minusdem[minusdem.size() - 1] != 0) {
            for (int i = 0; i < minusdem.size(); i++) {
                log += "2";
                if (i != minusdem.size() - 1) log += "3";
            }
            mrtvi += minusdem.size();
    }
    else if (minusdem.empty() && plusdem[plusdem.size() - 1] != 0) {
        for (int i = 0; i < plusdem.size(); i++) {
            if (2 * i + 1 <= plusdem[plusdem.size() - i]) {
                log += "1";
                mrtvi += 1;
            }
            if (log[log.size() - 1] != '2') log += "2";
        }
    }




    cout << "\n" << mrtvi << "\n" << log;

    return 0;
}