#include <bits/stdc++.h>
#define endl '\n'
typedef long long ll;
using namespace std;

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N; cin >> N;
    vector<int> sever;
    vector<int> jug;

    while (N--)
    {
        int x;
        cin >> x;

        if (x < 0)
        {
            jug.push_back(x);
        }
        else
        {
            sever.push_back(x);
        }
    }

    sort(jug.rbegin(), jug.rend());
    sort(sever.begin(), sever.end());

    int hx = 0;

    char potezi[(int)pow(10, 6) + 1];

    int i = 0;

    int elim = 0;
    int last = 0;
    while (!(jug.empty() && sever.empty()) && !(hx == jug[0] || hx == sever[0]))
    {
        if (i == pow(10, 6)) break;
        if (!(jug.empty()) && abs(hx - jug[0]) <= abs(hx - sever[0]) && last != 2)
        {
            potezi[i] = ('2');
            last = 2;
            i++;
            jug.pop_back();
            elim++;
        }
        else if (!(sever.empty()) && last != 1)
        {
            potezi[i] = ('1');
            last = 1;
            i++;
            sever.pop_back();
            elim++;
        }
        else
        {
            potezi[i] = ('3');
            last = 3;
            i++;
        }
        jug[0]++;
        sever[0]--;
        sort(jug.rbegin(), jug.rend());
        sort(sever.begin(), sever.end());
    }
    potezi[i] = 0;
    cout << elim << endl << potezi << endl;
    return 0;
}