#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    long long db =0;
    long long kills = 0;
    long long haladas =0;
    int n;
    long long harry =0;
    int lepesek = 0;
    bool egy = false;
    bool ketto = false;
    bool harom = false;
    string eredmeny = "";
    cin >> n;
    string b;
    vector<long long> pe;
    vector<long long> nd;
    for(int i=0;i<n;i++){
        db++;
        long long x;
        cin >> x;
        if(x < 0){
            x*=-1;
            nd.push_back(x);
        }
        else{
            pe.push_back(x);
        }
    }
    sort(nd.begin(), nd.end());
    sort(pe.begin(),pe.end());
    reverse(nd.begin(),nd.end());
    reverse(pe.begin(),pe.end());
    int neg = nd.size();
    int poz = pe.size();

    while(db >0){
        if(eredmeny.length() == 1000000){
            b= eredmeny;
        }
        if( !(pe.empty()) && !(nd.empty())){
            if( pe[poz-1] - haladas == harry || (nd[neg-1] * (-1))+haladas == harry){
                cout << kills << '\n';
                cout << eredmeny << '\n';
                return 0;
            }
            if(pe[poz-1] > nd[neg-1]){
                if(!ketto){
                    ketto= true;
                    egy = false;
                    harom = false;
                    kills++;
                    db--;
                    eredmeny += '2';
                    haladas++;
                    nd.pop_back();
                }
                else if(!egy){
                    harom = false;
                    ketto = false;
                    egy = true;
                    kills++;
                    db--;
                    haladas++;
                    eredmeny += '1';
                    pe.pop_back();
                }
                else if(!harom){
                    harom = true;
                    ketto = false;
                    egy = false;
                    haladas++;
                    harry++;
                    eredmeny+='3';
                }
            }
            else if(pe[poz-1] <= nd[neg-1]){
                    if(!egy){
                        egy=true;
                        kills++;
                        ketto = false;
                        harom = false;
                        db--;
                        haladas++;
                        eredmeny+='1';
                        pe.pop_back();
                    }
                    else if(!ketto){
                        ketto = true;
                        harom = false;
                        egy = false;
                        db--;
                        haladas++;
                        kills++;
                        eredmeny+='2';
                        nd.pop_back();
                    }
                    else if(!harom){
                        harom = true;
                        ketto = false;
                        egy = false;
                        haladas++;
                        eredmeny+= '3';
                        harry++;
                    }
                }
            }
        else if(pe.empty() && !(nd.empty())){
            if( (nd[neg-1]* (-1) ) + haladas == harry){
                cout << kills << '\n';
                cout << eredmeny << '\n';
                return 0;
            }
            if(!ketto){
                ketto=true;
                harom = false;
                egy = false;
                kills++;
                db--;
                haladas++;
                eredmeny+='2';
                nd.pop_back();
            }
            else if(!harom){
                harom = true;
                ketto = false;
                egy =false;
                haladas++;
                harry++;
                eredmeny +='3';
            }
            else if(!egy){
                egy = true;
                ketto = false;
                harom = false;
                haladas++;
                eredmeny += '1';
            }
        }
        else if(!(pe.empty()) && nd.empty()){
            if(pe[poz-1] - haladas == harry){
                cout << kills << '\n';
                cout << eredmeny << '\n';
                return 0;
            }
            if(!egy){
                egy = true;
                ketto = false;
                harom = false;
                db--;
                kills++;
                haladas++;
                eredmeny += '1';
                pe.pop_back();
            }
            else if(!ketto){
                ketto = true;
                egy = false;
                harom = false;
                haladas++;
                eredmeny+='2';
            }
            else if(!harom){
                harom = true;
                ketto = false;
                egy = false;
                haladas++;
                harry++;
                eredmeny +='3';
            }
        }
        neg = nd.size();
        poz = pe.size();
    }

    cout << kills << '\n';
    if(eredmeny.length() > 1000000){
        cout << b << '\n';
    }
    else{
        cout << eredmeny << '\n';
    }
    return 0;
}