#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() && sever[is] - pc + hpx <= hpx) break;
        if (ij < jug.size() && jug[ij] + pc + hpx >= hpx) break;
        if (is >= sever.size() && ij >= jug.size()) break;

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

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