#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, x; vector<int> vn, vp; string s; char c;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        if (x < 0) {
            vn.push_back(x);
        }
        else {
            vp.push_back(x);
        }
    }
    x = 0;
    sort (vn.begin(), vn.end());
    sort (vp.begin(), vp.end(), greater<int>());
    vn.push_back(0);
    vp.push_back(0);
    if (vn[vn.size()-1] == -1 && vp[vp.size()-1] == 1) {
        cout << 1 << '\n' << 1;
        return 0;
    }
    for (int i = 1; i < n; i++) {
        if (vp[0] == vp[i] || vn[0] == vn[i]) {
            break;
        }
        if (abs(vn[i]) < vp[i]) {
            c = '2';
            s += c;
            x++;
            vn.remove(i);
            vn[0]++;
            vp[0]++;
        }
        else if (vp[i] <= abs(vn[i])) {
            c = '1';
            s += c;
            x++;
            vp.remove(i);
            vn[0]++;
            vp[0]++;
        }
    }
    cout << x << '\n' << s;
}