#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int> dementori;
    string komande="";
    int parni=0;
    int br_dem=0;
    int pozitivni=0;
    for(int i =0;i<n;i++){
        int xi;
        cin>>xi;
        if (xi%2==0){parni+=1;}
        if (xi>0){pozitivni+=1;}
        dementori.push_back(xi);
    }
    if(parni==n){
        if (n>=1e6){
            br_dem=1e6;
        }else{br_dem=n;}
        cout<<br_dem<<endl;
        vector<int> poz_dem={};
        vector<int> neg_dem_abs={};
        for (int i =0;i<n;i++){
            if(dementori[i]>0){
                poz_dem.push_back(dementori[i]);
            }
            else{
                neg_dem_abs.push_back(abs(dementori[i]));
            }
        }
        sort(poz_dem.begin(),poz_dem.end());
        sort(neg_dem_abs.begin(),neg_dem_abs.end());
        int broj_poz_skinutih=0;
        int broj_neg_skinutih=0;
        for(int i =0;i<br_dem;i++){
            if(poz_dem[broj_poz_skinutih]<=neg_dem_abs[broj_neg_skinutih]){
                broj_poz_skinutih++;
                komande+="1";
            }
            else{
                broj_neg_skinutih++;
                komande+="2";
            }
        }
        cout<<komande;

    }

    
}