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

signed main()
{
    int n;
    cin>>n;
    set<int>a,b;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        if(c>0)a.insert(c);
        else b.insert(-c);
    }
    string s="";
    int ans=0;
    int t1=0,t2=0,p,q,prethodni=0;
    for(int i=0;i<1000000 and ans<n;i++){
        if(a.size())
            p=*a.begin();
        else p=2000000000;
        if(b.size())
            q=*b.begin();
        else q=2000000000;
        if(p==q and p==t1+1){
            ans++;
            if(prethodni==1)s+='2';
            else s+='1';
            break;
        }

        else if(p==t1+1 and prethodni ==1){
            if(b.size())ans++;
            s+='2';
            break;
        }
        else if(q==t2+1 and prethodni== 2){
            if(p==t1+2){ans++;s+='1';break;}
            t1+=2;
            s+='3';
            prethodni=3;
        }
        else if(p<=q and p!=2000000000 and prethodni!=1){
            t1++;
            t2++;
            ans++;
            s+='1';
            prethodni=1;
            a.erase(p);
        }
        else if (prethodni==1 and p<=q and p!=2000000000){
            t1++;
            t2++;
            if(b.size())ans++,b.erase(q);
            s+='2';
            prethodni=2;
        }
        else if (prethodni!=2){
            t1++;
            t2++;
            ans++;
            s+='2';
            prethodni=2;
            b.erase(q);
        }
        else{
            if(p==t1+2){
                s+='1';
                break;
            }
            else{
                t1+=2;
                s+='3';
                prethodni=3;
            }
        }
    }
    cout<<ans<<endl<<s;

    return 0;
}