#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,i,br1=0,br2=0,pamti,brsk,brp,pok1,pok2,res1,res12,p1,p2;
    cin >> n;
    vector<ll>so,no;
    string s(4*n,'0'),s2(4*n,'0');
    for(i=0;i<n;i++)
    {
        cin >> x;
        if(x>0)
        {
            br1++;
            no.pb(x);
        }
        else
        {
            br2++;
            x*=-1;
            so.pb(x);
        }
    }
    no.pb(1e10);
    so.pb(1e10);
    sort(no.begin(),no.end());
    sort(so.begin(),so.end());
    if(br1)
    {
        brp=1;
        brsk=0;
        pok1=1;
        pok2=0;
        res1=1;
        s[0]='1';
        while(true)
        {
            if(no[pok1]==1e10 && (so[pok2]==no[pok1]))
            {
                break;
            }
            if(no[pok1]-brsk-brp==0)
            {
                break;
            }
            if(so[pok2]+brsk-brp==0)
            {
                break;
            }
            p1=no[pok1]-brsk-brp;
            p2=so[pok2]+brsk-brp;
            if(s[brp-1]=='1')
            {
                s[brp]='2';
                if(so[pok2]!=1e10)
                {
                    pok2++;
                    res1++;
                }
            }
            else
            {
                if((p1<=2))
                {
                    s[brp]='1';
                    if(no[pok1]!=1e10)
                    {
                        pok1++;
                        res1++;
                    }
                }
                else
                {
                    if(p2==1)
                    {
                        s[brp]='3';
                        brsk++;
                    }
                    else
                    {
                        s[brp]='1';
                        if(no[pok1]!=1e10)
                        {
                            pok1++;
                            res1++;
                        }


                    }
                }
            }
            brp++;
        }
        pamti=brp;
    }

    if(br2)
    {
        brp=1;
        brsk=0;
        pok1=0;
        pok2=1;
        res12=1;
        s2[0]='2';
        while(true)
        {
            if(no[pok1]==1e10 && (so[pok2]==no[pok1]))
            {
                break;
            }
            if(no[pok1]-brsk-brp==0)
            {
                break;
            }
            if(so[pok2]+brsk-brp==0)
            {
                break;
            }
            p1=no[pok1]-brsk-brp;
            p2=so[pok2]+brsk-brp;
            if(s2[brp-1]=='1')
            {
                s2[brp]='2';
                if(so[pok2]!=1e10)
                {
                    pok2++;
                    res12++;
                }
            }
            else
            {
                if((p1<=2))
                {
                    s2[brp]='1';
                    pok1++;
                    res12++;
                }
                else
                {
                    if(p2==1)
                    {
                        s2[brp]='3';
                        brsk++;
                    }
                    else
                    {
                        s2[brp]='1';
                        if(no[pok1]!=1e10)
                        {
                            pok1++;
                            res12++;
                        }


                    }
                }
            }
            brp++;
        }
    }
    if((res1>res12) || (br2==0))
    {
        string s3(pamti,'0');
        for(i=0;i<pamti;i++)
        {
            s3[i]=s[i];
        }
        cout << res1 << endl << s3;
    }
    else
    {
        string s3(brp,'0');
        for(i=0;i<brp;i++)
        {
            s3[i]=s2[i];
        }
        cout << res12 << endl << s3;
    }



}

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