#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,pom,res=0,pot=0,poraz=0;
    cin>>n;
    deque <pair <long long, long long> > pd(n);
    deque <long long> res2;
    for(i=0;i<n;i++)
    {
        cin>>pom;
        pd[i].first=abs(pom);
        pd[i].second=pom;
    }
    sort(pd.begin(), pd.end());
    while(pd.size()!=0 && res<1000000 && poraz!=1)
    {
        if(pd[0].first==pd[1].first && pd[0].first-pot==1)
        {
            res++;
            pot++;
            res2.push_front(1);
            pd.pop_front();
            poraz=1;
        }
        else if(pd[0].first-pot==pd[1].first-pot && pd.size()>1 && pd[0].second!=pd[1].second)
        {
            res+=2;
            pot+=2;
            res2.push_back(1);
            res2.push_back(2);
            pd.pop_front();
            pd.pop_front();
        }
        else if(pd[0].second>0)
        {
            pd.pop_front();
            res2.push_back(1);
            pot++;
            res++;
        }
        else if(pd[0].second<0)
        {
            pd.pop_front();
            res2.push_back(2);
            pot++;
            res++;
        }
    }
    cout<<res<<endl;
    for(i=0;i<res2.size();i++)
    {
        cout<<res2[i];
    }
    return 0;
}