#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);
        }
    }
    ll tr = 1;
    ll iv = 0, im = 0;
    ll res1 = 0;
    string s1 = "1";
    ll prethodni = 1;
    iv++;
    while(im < manji.size() and iv < veci.size()){
        if(manji[im] - tr <= 0 or veci[iv] - tr <= 0){
            break;
        }
        if(manji[im] - tr == 1 and prethodni == 2){
            s1 += '3';
        }
        if(prethodni == 3){
            im++;
            s1 += '2';
        }
        else if(prethodni == 1){
            s1 += '2';
            im++;
        }
        else{
            s1 += '1';
            iv++;
        }
        prethodni = s1[s1.size() - 1] - '0';
        tr++;
    }
    while(im < manji.size()){
        if(manji[im] - tr == 0){
            break;
        }
        if(prethodni == 1){
            s1 += '2';
        }
        else if(prethodni == 2){
            s1 += '3';
        }
        else{
            s1 += '2';
        }
        im++;
        tr++;
    }
    while(iv < veci.size()){
        if(veci[iv] - tr <= 0){
            break;
        }
        if(prethodni == 2 or prethodni == 3){
            s1 += '1';
            iv++;
        }
        else{
            s1 += '3';
            tr++;
        }
        tr++;
    }
    cout << s1.size() << endl;
    cout << s1 << endl;

}