#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;

    for (int i = 0; i < N; i++)
    {
        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());

    char potezi[1000005];
    int zp = -1;
    int hpx = 0;
    int pc = 0;
    int killc = 0;

    int is = 0;
    int ij = 0;

    while (pc < 1000000)
    {
        if (is >= sever.size() && ij >= jug.size()) break;

        if (is < sever.size() && sever[is] - pc - hpx <= 0) break;
        if (ij < jug.size() && hpx - (jug[ij] + pc) <= 0) break;

        if (is < sever.size() && ij < jug.size())
        {
            int dS = sever[is] - pc - hpx;
            int dJ = hpx - (jug[ij] + pc);

            if (zp != 2 && dJ <= dS)
            {
                zp = 2;
                potezi[pc] = '2';
                ij++;
                killc++;
            }
            else if (zp != 1 && dS < dJ)
            {
                zp = 1;
                potezi[pc] = '1';
                is++;
                killc++;
            }
            else if (zp != 3)
            {
                zp = 3;
                potezi[pc] = '3';
                hpx++;
            }
            else if (zp != 1)
            {
                zp = 1;
                potezi[pc] = '1';
                is++;
                killc++;
            }
            else
            {
                zp = 2;
                potezi[pc] = '2';
                ij++;
                killc++;
            }
        }
        else if (ij >= jug.size())
        {
            int dS = sever[is] - pc - hpx;
            if (zp != 1 && dS > 1)
            {
                zp = 1;
                potezi[pc] = '1';
                is++;
                killc++;
            }
            else if (zp != 3 && dS > 2)
            {
                zp = 3;
                potezi[pc] = '3';
                hpx++;
            }
            else if (zp != 1)
            {
                zp = 1;
                potezi[pc] = '1';
                is++;
                killc++;
            }
            else break;
        }
        else if (is >= sever.size())
        {
            int dJ = hpx - (jug[ij] + pc);
            if (zp != 2 && dJ > 1)
            {
                zp = 2;
                potezi[pc] = '2';
                ij++;
                killc++;
            }
            else if (zp != 3)
            {
                zp = 3;
                potezi[pc] = '3';
                hpx++;
            }
            else if (zp != 2)
            {
                zp = 2;
                potezi[pc] = '2';
                ij++;
                killc++;
            }
            else break;
        }
        pc++;
    }
    potezi[pc] = 0;

    cout << killc << endl << potezi << endl;
    return 0;
}