#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 killed = 0, dir = 0, offset = 0, moved = 0;

    if (rightboo.empty()) {
        dir = -1;
        while (!leftboo.empty() && leftboo.back() - offset != moved) {
            if (dir == -1) {
                leftboo.pop_back();
                killed++;
                moves.push_back('2');
            }
            else {
                moved++;
                moves.push_back('3');
            }

            dir *= -1;
            offset++;
        }
    }
    else if (leftboo.empty()) {
        dir = 1;
        while (!rightboo.empty() && rightboo.back() - offset != moved) {
            if (dir == 1) {
                rightboo.pop_back();
                killed++;
                moves.push_back('1');
            }
            else {
                moves.push_back('2');
            }

            dir *= -1;
            offset++;
        }
    }
    else {
        // cout << "nightmail\n";
        if (rightboo.back() <= leftboo.back()) {
            dir = 1;
        }
        else {
            dir = -1;
        }
        while ((!leftboo.empty() || !rightboo.empty()) && (leftboo.back() - offset != moved && rightboo.back() - offset != moved)) {
            if (dir == 1) {
                if (!rightboo.empty()) {
                    rightboo.pop_back();
                    killed++;
                    moves.push_back('1');
                }
                else {
                    moves.push_back('3');
                }
            }
            else {
                if (!leftboo.empty()) {
                    leftboo.pop_back();
                    killed++;
                }
                moves.push_back('2');
            }

            dir *= -1;
            offset++;
        }
    }

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

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

    return 0;
}