#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());
    char potezi[1000000];
    int zp = -1;

    int hpx = 0;
    int pc = 0;

    #define pjug jug[0]
    #define psever sever[0]
    while (pjug != hpx && psever != hpx && pc <= 1000000 && !(jug.empty() && sever.empty()))
    {
        if (!jug.empty() && !sever.empty())
        {
            if (zp != 2 && abs(pjug - hpx) <= abs(psever - hpx))
            {
                zp = 2;

                potezi[pc] = '2';
                pc++;
                jug.erase(jug.begin());
            }
            else if (zp != 1)
            {
                zp = 1;

                potezi[pc] = '1';
                pc++;
                sever.erase(sever.begin());
            }
            else
            {
                zp = 3;
                potezi[pc] = '3';
                pc++;
                hpx++;
            }
        }
        else if (jug.empty())
        {
            if (zp != 1)
            {
                zp = 1;

                potezi[pc] = '1';
                pc++;
                sever.erase(sever.begin());
            }
            else if (zp != 3)
            {
                zp = 3;
                potezi[pc] = '3';
                pc++;
                hpx++;
            }
            else
            {
                zp = 2;

                potezi[pc] = '2';
                pc++;
            }
        }

        else if (sever.empty())
        {
            if (zp != 2)
            {
                zp = 2;

                potezi[pc] = '2';
                pc++;
                jug.erase(jug.begin());
            }
            else if (zp != 1)
            {
                zp = 1;

                potezi[pc] = '1';
                pc++;
            }
            else
            {
                zp = 3;
                potezi[pc] = '3';
                pc++;
                hpx++;
            }
        }
        for (int i = 0; i < jug.size(); i++)
        {
            jug[i]++;
        }
        for (int i = 0; i < sever.size(); i++)
        {
            sever[i]--;
        }
        sort(sever.begin(), sever.end());
        sort(jug.begin(), jug.end());
    }
    potezi[pc] = 0;

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