#include <bits/stdc++.h>
using namespace std;
/*
void ispis(int a){
    vector<vector<int>> v(a+1, vector<int>(a+1,1));
    for (int i=1;i<= a;i++){
        for(int j = 1; j <= a-i;j++){
            v[i][j]=0;
        }
    }
    for (int i=1;i<= a;i++){
        for(int j = 1; j <= a;j++){
            cout<<v[i][j]<<" ";
        }cout<<"\n";
    }
}
*/
int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    int n; cin>>n;
    vector<int> l, d;
    for(int i=0; i < n;i++){
        int a;cin>> a;
        if(a < 0)l.push_back(a);
        else d.push_back(a);
    }
    int h=0,pr=0,br=0,ub=0;
    sort(l.begin(),l.end());int pozl=l.size()-1,protiv_levo = l.size(),najbl = l[pozl];
    sort(d.begin(),d.end());int pozd=0,protiv_desno = d.size(),najbd = d[pozd];
    //for(int i=0; i < l.size();i++)cout << l[i]<<" ";cout<<endl;
    //for(int i=0; i < d.size();i++)cout << d[i]<<" ";cout<<endl;
    int najb = min(h-najbl,najbd-h);//cout<<najb<<endl;
    string potezi = "";
    while(najb>0){
        if(pr!=3 && (pr!=2 && pr != 0)  && najbl==h-1){
            h++;br++;
            najbl++;
            najbd--;
            pr = 3;
            potezi+='3';
            //cout <<pr;
        }
        else if(h-najbl <= najbd-h && pr != 2){
            br++;protiv_levo--;
            if(protiv_levo>0)najbl = l[pozl-1]+br;else najbl = -10000000;
            najbd--;
            pr = 2;
            ub++;
            potezi+='2';
            //cout <<pr;
        }
        else if(najbd-h <= h-najbl && pr != 1){
            br++;protiv_desno--;
            najbl++;
            if(protiv_desno>0)najbl = d[pozd+1]+br;else najbd = 10000000;
            pr = 1;
            //cout <<pr;
            potezi+='1';
            ub++;
        }

            //cout << h-najbl << " "<< najbd-h<<endl;
            najb = min(h-najbl,najbd-h);
            //cout <<najb <<" najb"<< endl;
            if(protiv_levo == 0 && protiv_desno==0){
                //cout << "kraj";
                break;
            }
    }
    cout << ub <<"\n";
    cout << potezi;

}
/*
std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
*/