#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, br_s=0, br_j=0, br_poteza=0, i_h=0;
    cin>>n;
    int pds=n, pdj;
    vector<int> a(n);
    vector<short> s;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(a[i]>0)
            br_s++;
        else
            br_j++;
    }
    sort(a.begin(),a.end());
    for(int i=0;i<n && i_h==n;i++)
        if(a[i]>0)
            pds=i;
    pdj=pds-1;
    while((br_s>0 || br_j>0) && pds>=0 && a[pds]-br_poteza>i_h && pdj<n && a[pdj]+br_poteza<i_h)
    {
        if(br_j==0)
        {
            if(s[br_poteza-1]==1)
            {
                s.push_back(2);
            }
            else
            {
                pds++;
                br_s--;
                s.push_back(1);
            }
        }
        else if(br_s==0)
        {
            if(s[br_poteza-1]==2)
            {
                i_h++;
                s.push_back(3);
            }
            else
            {
                pds++;
                br_s--;
                s.push_back(2);
            }
        }
        else
        {
            if(a[pds]-i_h<=i_h-a[pdj] && s[br_poteza-1]!=1)
            {
                pds++;
                br_s--;
                s.push_back(1);
            }
            else if(s[br_poteza-1]!=2)
            {
                pds++;
                br_s--;
                s.push_back(2);
            }
            else
            {
                i_h++;
                s.push_back(3);
            }
        }
        br_poteza++;
    }
    cout<<n-br_j-br_s<<'\n';
    for(int i=0;i<br_poteza;i++)
        cout<<s[i];
    return 0;
}