#include <bits/stdc++.h>
#define endl '\n'
#define fi first
#define se second
#define pb push_back

using namespace std;

using ll = long long;

void solve()
{
    ll n,i,x,res=0,p1,p2,kojismor1,kojismor2;
    priority_queue<ll>q1,q;
    cin >> n;
    string s(3*n,'0');
    for(i=0;i<n;i++)
    {
        cin >> x;
        if(x>0)
        {
            q.push(x*(-1));
        }
        else
        {
            q1.push(x);
        }
    }
    ll vr=(-1)*(10000000000);
    q1.push(vr);
    q.push(vr);
    ll pok=-1;
    ll plu=0;
    ll turn=0;
    while(true)
    {

        p1=q.top()*(-1)-plu-turn;
        p2=q1.top()*(-1)+plu-turn;
        kojismor1=p1+plu+turn;
        kojismor2=p2-plu+turn;

        if((p1==0) || (p2==0))
        {
            break;
        }
        if((kojismor1==kojismor2) && (kojismor1==1e10))
        {
            break;
        }
        turn++;
        pok++;
        if(p1<p2)
        {
            if((pok==0) || (s[pok-1]!='1'))
            {
                s[pok]='1';
                q.pop();
                res++;
                continue;
            }

            s[pok]='2';
            if(kojismor2!=1e10)
            {
                res++;
                q1.pop();
            }


        }
        else
        {
            if((pok==0) || (s[pok-1]!='2'))
            {
                s[pok]='2';
                q1.pop();
                res++;
                continue;
            }
            if(p2==p1)
            {
                s[pok]='1';
                q.pop();
                res++;
            }
            else
            {
                plu++;
                s[pok]='3';
            }
        }

    }
    cout << res << endl;
    string s2(turn,'0');
    for(i=0;i<turn;i++)
    {
        s2[i]=s[i];
    }
    cout << s2 << endl;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    //  cin >> t;
    while (t--)
    {
        solve();
    }
}