#include <bits/stdc++.h>

using namespace std;

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

    int n; cin >> n;
    vector<long long> boo(n), rightboo, leftboo;
    vector<char> moves;
    long long x;
    // cout << "ok sam" << endl;
    for (long long i = 0; i < n; i++) {
        cin >> x;

        if (x > 0) rightboo.push_back(x);
        else leftboo.push_back(-x);
    }

    rightboo.push_back(0);
    rightboo.pop_back();

    leftboo.push_back(0);
    leftboo.pop_back();

    // cout << "poz1\n";

    //sort(boo.begin(), boo.end(), [](long long a, long long b){
    //    return llabs(a) < llabs(b);
    //});
    if (!rightboo.empty())
        sort(rightboo.begin(), rightboo.end(), [](long long a, long long b){
            return llabs(a) > llabs(b);
        });
    if (!leftboo.empty())
        sort(leftboo.begin(), leftboo.end(), [](long long a, long long b){
            return llabs(a) > llabs(b);
        });

    int offset = 0, killed = 0, dir = 0, moved = 0;
    while (!leftboo.empty() || !rightboo.empty()) {
        if ((!rightboo.empty() && rightboo.back() - offset == moved) || (!leftboo.empty() && leftboo.back() - offset == moved)) {
                // cout << "oh hell naw\n";
            break;
        }

        // cout << "poz\n";

        if ((rightboo.empty() || rightboo.back() - offset - moved >= 3) && dir == 1) {
            moves.push_back('3');
            moved++;
        }

        else if ((leftboo.empty()) || (!rightboo.empty() && !leftboo.empty() && rightboo.back() < leftboo.back())) {
            if (dir == 0) dir = 1;
            if (dir >= 0) {
                moves.push_back('1');
                if (!rightboo.empty()) {
                    rightboo.pop_back();
                    killed++;
                }
            }
            else {
                if (!leftboo.empty()) {
                    // boo[indicies[leftboo[-1]]] = 0;
                    leftboo.pop_back();
                    killed++;
                }
                moves.push_back('2');
            }
        }
        else {
            if (dir == 0) dir = -1;
            if (dir <= 0) {
                moves.push_back('2');
                if (!leftboo.empty()) {
                    // boo[indicies[leftboo[-1]]] = 0;
                    leftboo.pop_back();
                    killed++;
                }
            }
            else {
                if (!rightboo.empty()) {
                    // boo[indicies[leftboo[-1]]] = 0;
                    rightboo.pop_back();
                    killed++;
                }
                moves.push_back('1');
            }
        }

        dir *= -1;
        offset++;
        // cout << leftboo.back() - offset << " " << rightboo.back() - offset << "\n";
    }
    cout << killed << "\n";
    for (auto mov : moves) {
        cout << mov;
    }
    cout << "\n";

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

    return 0;
}