#include<bits/stdc++.h>
using namespace std;
int n,brl,brd,a,prvi = 1, drugi = 1,br;
string s;
int nizl[200005], nizd[200005];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;

    for(int i = 1; i <= n; i++){
        cin>>a;
        if(a <= 0){
        brl++;
        nizl[brl] = a*-1;
        }
        if(a >= 0){
        brd++;
        nizd[brd] = a;
        }
    }
    sort(nizl + 1, nizl + 1 + brl);
    sort(nizd + 1, nizd + 1 + brd);

    if(brl == n){
        cout<<brl<< endl;
        for(int i = 1; i <= n; i++){
            s += "3";
            s += "2";
        }
        cout<<s<< endl;
        return 0;
    }

    if(brd == n){
        cout<<brd<< endl;
        for(int i = 1; i <= n-1; i++){
            s += "12";
        }
        s+="1";
        cout<<s<< endl;
        return 0;
    }

    for(int i = 1; i <= n; i++){
        if(nizl[prvi] >= nizd[drugi]){
            prvi++;
            br++;
            s += "1";
        }
        else if(nizl[prvi] < nizd[drugi]){
            drugi++;
            br++;
            s += "2";
        }
        if(br == 1000000){
            cout<<br<< endl;
            cout<<s<< endl;
            return 0;
        }
    }
//    for(int i = 1; i <= brl; i ++){
//        cout<<nizl[i]<< endl;
//    }
//    for(int i = 1; i <= brd; i ++){
//        cout<<nizd[i]<< endl;
//    }
    cout<<br<< endl;
    cout<<s<< endl;



    return 0;
}