#include <bits/stdc++.h>

using namespace std;

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

    long long n; cin >> n;
    vector<long long> boo(n);
    vector<char> moves;
    for (long long i = 0; i < n; i++) {
        cin >> boo[i];
    }

    sort(boo.begin(), boo.end(), [](long long a, long long b){
        return llabs(a) < llabs(b);
    });

    int offset = 0, killed = 0;
    for (int i = 0; i < n; i++) {
        if ((boo[i] > 0 && boo[i] - offset == 0) || (boo[i] < 0 && boo[i] + offset == 0)) {
            break;
        }

        if (boo[i] > 0) moves.push_back('1');
        else moves.push_back('2');

        killed++;
        offset++;
    }
    cout << killed << "\n";
    for (auto mov : moves) {
        cout << mov;
    }
    cout << "\n";

    // cout << LLONG_MAX << "\n";

    return 0;
}