#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n, x;
    cin >> n;
    vector<ll>veci;
    vector<ll>manji;
    for(ll i = 0; i < n; i++){
        cin >> x;
        if(x > 0){
            veci.push_back(x);
        }
        else{
            manji.push_back(-x);
        }
    }
    sort(manji.begin(), manji.end());
    sort(veci.begin(), veci.end());
    ll trg = 1, trd = 1;
    ll iv = 0, im = 0;
    string s1 = "1";
    ll minus1 = 0;
    ll prethodni = 1;
    iv++;
    if(veci.size() == 0){
        minus1++;
    }
    while(im < manji.size() and iv < veci.size()){
        if(manji[im] - trd <= 0 or veci[iv] - trg <= 0){
            break;
        }
        if(manji[im] - trd == 1 and prethodni == 2){
            s1 += '3';
            minus1++;
            trg++;
            trd--;
        }
        else if(prethodni == 3){
            im++;
            s1 += '2';
        }
        else if(prethodni == 1){
            s1 += '2';
            im++;
        }
        else{
            s1 += '1';
            iv++;
        }
        prethodni = s1[s1.size() - 1] - '0';
        trg++;
        trd++;
    }
    while(im < manji.size() and iv >= veci.size()){
        if(manji[im] - trd == 0){
            break;
        }
        if(prethodni == 1){
            s1 += '2';
        }
        else if(prethodni == 2){
            s1 += '3';
            im--;
            minus1++;
            trd--;
        }
        else{
            s1 += '2';
        }
        im++;
        trd++;
        prethodni = s1[s1.size() - 1] - '0';
    }
    while(iv < veci.size() and im >= manji.size()){
        if(veci[iv] - trg <= 0){
            break;
        }
        if(prethodni == 2 or prethodni == 3){
            s1 += '1';
            iv++;
        }
        else{
            s1 += '2';
            minus1++;
        }
        trg++;
        prethodni = s1[s1.size() - 1] - '0';
    }
    im = 1;
    iv = 0;
    trg = 1;
    trd = 1;
    string s2 = "2";
    ll minus2 = 0;
    prethodni = 2;
    if(manji.size() == 0){
        minus2++;
    }
    while(im < manji.size() and iv < veci.size()){
        if(manji[im] - trd <= 0 or veci[iv] - trg <= 0){
            break;
        }
        if(manji[im] - trd == 1 and prethodni == 2){
            s2 += '3';
            minus2++;
            trg++;
            trd--;
        }
        else if(prethodni == 3){
            im++;
            s2 += '2';
        }
        else if(prethodni == 1){
            s2 += '2';
            im++;
        }
        else{
            s2 += '1';
            iv++;
        }
        prethodni = s2[s2.size() - 1] - '0';
        trg++;
        trd++;
    }
    while(im < manji.size() and iv >= veci.size()){
        if(manji[im] - trd == 0){
            break;
        }
        if(prethodni == 1){
            s2 += '2';
        }
        else if(prethodni == 2){
            s2 += '3';
            minus2++;
            trd--;
            im--;
        }
        else{
            s2 += '2';
        }
        im++;
        trd++;
        prethodni = s2[s2.size() - 1] - '0';
    }
    while(iv < veci.size() and im >= manji.size()){
        if(veci[iv] - trg <= 0){
            break;
        }
        if(prethodni == 2 or prethodni == 3){
            s2 += '1';
            iv++;
        }
        else{
            s2 += '2';
            minus2++;
        }
        trg++;
        prethodni = s2[s2.size() - 1] - '0';
    }
    cout << max(s1.size() - minus1, s2.size() - minus2) << endl;
    if((s1.size() - minus1) > (s2.size() - minus2)){
        cout << s1 << endl;
    }
    else{
        cout << s2 << endl;
    }
}