#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,x,vr,br1=0,br2=0,res1,res2,i,brsk,brp,pok1,pok2,pamtimo1,pamtimo2;
    vector<ll>noo,so;
    cin >> n;
    string s1(6*n,'0'),s2(6*n,'0');
    for(i=0;i<n;i++)
    {
        cin >> x;
        if(x>0)
        {
            noo.pb(x);
            br1++;
        }
        else
        {
            so.pb(x*(-1));
            br2++;
        }
    }
    vr=1e18;
    noo.pb(vr);
    so.pb(vr);
    sort(noo.begin(),noo.end());
    sort(so.begin(),so.end());
    res1=0;
    res2=0;
    if(br1>0)
    {
        brsk=0;
        brp=1;
        pok1=1;
        pok2=0;
        s1[0]='1';
        res1=1;
        while(true)
        {
            if((noo[pok1]==so[pok2]) && (noo[pok1]==vr))
            {
                break;
            }
            if(noo[pok1]-brsk-brp==0)
            {
                break;
            }
            if(so[pok2]-brp+brsk==0)
            {
                break;
            }
            if((s1[brp-1]=='1') || (s1[brp-1]=='3'))
            {
                s1[brp]='2';
                if(so[pok2]!=vr)
                {
                    pok2++;
                    res1++;
                }
            }
            else
            {
                if(noo[pok1]-brsk-brp<=2)
                {
                    s1[brp]='1';
                    if(noo[pok1]!=vr)
                    {
                        pok1++;
                        res1++;
                    }
                }
                else if(so[pok2]-brp+brsk==1)
                {
                    brsk++;
                    s1[brp]='3';
                }
                else
                {
                    s1[brp]='1';
                    if(noo[pok1]!=vr)
                    {
                        pok1++;
                        res1++;
                    }
                }
            }
            brp++;
        }
        pamtimo1=brp;
    }
    if(br2>0)
    {
        brsk=0;
        brp=1;
        pok1=0;
        pok2=1;
        s2[0]='2';
        res2=1;
        while(true)
        {
            if((noo[pok1]==so[pok2]) && (noo[pok1]==vr))
            {
                break;
            }
            if(noo[pok1]-brsk-brp==0)
            {
                break;
            }
            if(so[pok2]-brp+brsk==0)
            {
                break;
            }
            if((s2[brp-1]=='1') || (s2[brp-1]=='3'))
            {
                s2[brp]='2';
                if(so[pok2]!=vr)
                {
                    pok2++;
                    res2++;
                }
            }
            else
            {
                if(noo[pok1]-brsk-brp<=2)
                {
                    s2[brp]='1';
                    if(noo[pok1]!=vr)
                    {
                        pok1++;
                        res2++;
                    }
                }
                else if(so[pok2]-brp+brsk==1)
                {
                    brsk++;
                    s2[brp]='3';
                }
                else
                {
                    s2[brp]='1';
                    if(noo[pok1]!=vr)
                    {
                        pok1++;
                        res2++;
                    }
                }
            }
            brp++;
        }
        pamtimo2=brp;
    }
    if((res1>res2) || (br2==0))
    {
        string s(pamtimo1,'0');
        for(i=0;i<pamtimo1;i++)
        {
            s[i]=s1[i];
        }
        cout << res1 << endl << s;
    }
    else
    {
        string s(pamtimo2,'0');
        for(i=0;i<pamtimo2;i++)
        {
            s[i]=s2[i];
        }
        cout << res2 << endl << s;
    }



}

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