#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
const int N = 2e5+10;
const int MOD = 1e9 + 7;
using namespace std;

void solve()
{
    int n,m;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++)cin>>a[i];
    sort(a.begin(),a.end());

    ll ans = 0;
    int idx1 = 0,idx2 = 0;

    if(a[0] > 0 ){
        idx1 = -1;
        idx2 = 0;
    }
    if(a[n-1] < 0 ){
        idx1 = n-1;
        idx2 = 2*n;
    }

    if(idx1==0 && idx2==0){
        for(int i = 0; i < n; i++){
            if(a[i] > 0 && a[i-1] < 0){
                idx1 = i-1;
                idx2 = i;
            }
        }
    }
    string s = "";
    ll sz = 0;

    if(idx1 == n-1 && idx2 == 2*n){
        ll l = 0;

        while(sz < 1e6 && ans!= n){
            if((l%2)==0ll){
                ans++;
                s.push_back('2');
                sz++;
                l++;
            }else{
                s.push_back('3');
                sz++;
                l++;

            }
        }

        cout <<ans<<"\n"<<s<<"\n";
        return;
    }
    /*
    if(idx1== -1 && idx2 == 0){
        int l = 0;
        while(sz<1e6 || ans != n){
            if(l%2==0){
                ans++;
                s.push_back('1');
                sz++;
                l++;
            }else{
                s.push_back('2');
                sz++;
                l++;
            }


        }
        cout <<ans<<"\n"<<s<<"\n";
        return;


    }*/


    ll cntneg = 0,cntpos = 0;
    int turn = -1;

    while(sz < 1e6 || ans!= n){
        if((turn == 1 || turn == -1) && idx2 <= n-1 && a[idx1] + cntneg == -1 && idx1 >= 0 && a[idx2]-cntpos <= 2){



            ans++;
            s.push_back('1');
            sz++;

            break;
        }else if(turn == 0 && a[idx2]-cntpos <= 1 && idx2 <= n-1){
            if(idx1>=0){
                ans++;
                s.push_back('2');
                break;
            }else{
                break;
            }

        }else if(a[idx1] + cntneg == -1 && (turn == -1 || turn == 0) && idx1 >= 0   ){
            ans++;
            idx1--;
            s.push_back('2');
            sz++;
            turn = 1;
            cntneg++;
            cntpos++;
        }else if(a[idx1] + cntneg == -1 && (turn == 1) && idx1 >= 0){
            cntpos+=2;
            turn =0;
            s.push_back('3');
            sz++;

        }else if(idx2 > n-1 && (turn == -1 || turn == 0)){
            cntpos++;
            cntneg++;
            turn = 1;
            idx1--;
            s.push_back('2');
            sz++;
            ans++;
        }else if(idx2 > n-1 && (turn==1)){
            turn = 0;
            s.push_back('3');
            sz++;
        }else if(idx1 < 0 && (turn == 0) && idx2 <= n-1){
            cntpos++;
            cntneg++;
            turn = 1;
            s.push_back('2');
            sz++;

        }else if(idx1 >= 0 && (turn == 0) && idx2 <= n-1){
            cntpos++;
            cntneg++;
            turn = 1;
            s.push_back('2');
            sz++;
            ans++;
            idx1--;
        }else if(idx2 <= n-1 && (turn==1 || turn==-1)){
            cntpos++;
            cntneg++;
            turn = 0;
            s.push_back('1');
            sz++;
            ans++;
            idx2++;
        }

        if(idx1 < 0 && idx2 > n-1){
            break;
        }
    }




    cout << ans << "\n" << s << "\n";



}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t = 1;
    //cin >> t;

    while(t--){
        solve();
    }

}