#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n;
    cin >> n;
    vector<int> neg, pos;
    for(int i = 0;i < n;i++){
        int x;
        cin >> x;
        if(x > 0) pos.push_back(x);
        else neg.push_back(-x);
    }

    sort(pos.begin(), pos.end()); sort(neg.begin(), neg.end());

    if(pos.size() == 0){
        cout << n << '\n';
        for(int i = 0;i < n;i++) cout << 23;
    }
    else if(neg.size() == 0){
        sort(pos.begin(), pos.end());
        int r = 0, k = 0;
        for(int i = 0;i < pos.size();i++){
            if(pos[i] - k <= 0) break;
            r++;
            k += 2;
        }
        cout << r << '\n';
        for(int i = 0;i < r;i++) cout << 12;
    }

    else{
        int prv = -1, ps = 0, k = 0, d = 0, p = 0, q = 0;
        vector<int> res;
        for(int i = 0;i < 1000000;i++){
            if(neg[p] - k <= ps || pos[q] - k <= ps) break;
            if(p >= neg.size() && q >= pos.size()) break;
            if(min(neg[p], pos[q]) == neg[p]){
                if(prv == -1 || prv == 1 || prv == 3) {
                    prv = 2;
                    d++;
                    p++;
                }
                else{
                    if(neg[p] - k == ps - 1 && pos[q] - k - 1 > ps + 1) {
                        ps++;
                        prv = 3;
                    }
                    else if(q < pos.size()){
                        d++;
                        prv = 1;
                        q++;
                    }
                }
            }
            else{
                if(prv == -1 || prv == 2 || prv == 3) {
                    prv = 1;
                    d++;
                    q++;
                }
                else if(p < neg.size()){
                    d++;
                    prv = 2;
                    p++;
                }
            }
            k++;
            res.push_back(prv);
        }

        cout << d << '\n';
        for(auto x : res) cout << x;
    }

    return 0;
}