#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 ans1 = 0,ans2 = 0;
    int idx1 = 0,idx2 = 0;

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

    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;
            }
        }
    }
    ll cnt = 0;
    string s ="";
    bool check = false;
    int turn = -1;
    //cout << idx1 << "  0   " << idx2 << "\n";
    while(true && ans1 < 1e6){

        if((a[idx1] + cnt >= 0 && idx1 >= 0 )){
            break;
        }
        if((a[idx2] - cnt <= 0 && idx2 <= n-1 )){
            break;
        }
        if((abs(a[idx1]+cnt) > abs(a[idx2]-cnt) || idx1 < 0) && (turn = 1 || turn == -1)){
            ans1++;
            s.push_back('2');
            idx1--;
            turn = 0;
            cnt++;
        }else if(!check){
            s.push_back('1');
            ans1++;
            idx2++;
            turn  = 1;
            cnt++;

        }else{
            s.push_back('3');
            turn = false;
            cnt++;
        }
        if(idx1 < 0 && idx2 > n-1){
            break;
        }
        if(idx2 > n-1){
            check = true;
        }
    }
    cout << ans1 << "\n" << s << "\n";



}

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

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

}