#include<bits/stdc++.h>

using namespace std;
int n, a[200005],brn,brp,dn,dp,nizn[200005],nizp[200005],d,res[500000],rd,br;
int main(){
  cin>>n;
  for(int i=1;i<=n;i++){
    cin>>a[i];
    if(a[i]<0){
      brn++;
      dn++;
      nizn[dn]=a[i];
    }
    else{
      brp++;
      dp++;
      nizp[dp]=a[i];
    }
  }
  if(brn==n){
    cout<<n<<endl;
    for(int i=1;i<=n;i++){
      cout<<2;
    }
    cout<<endl;
  }
  else if(brp==n){
    cout<<n<<endl;
    for(int i=1;i<=n;i++){
      cout<<1;
    }
    cout<<endl;
  }
  else{
    sort(nizp+1, nizp+dp+1);
    for(int i=1;i<=dn;i++){
      nizn[i]*=-1;
    }
    sort(nizn+1, nizn+dn+1);
    d=0;
    int dx=1;
    int dy=1;
    rd=1;
    while(d<n){
      if(dx>dp){
        res[rd]=2;
        rd++;
        dy++;
      }
      if(dy>dn){
        res[rd]=1;
        rd++;
        dx++;
      }
      if(nizp[dx]<=nizn[dy] && dx<=dp && dy<=dn){
        res[rd]=1;
        rd++;
        dx++;
      }
      else{
        res[rd]=2;
        rd++;
        dy++;
      }
      d++;
      for(int i=dx;i<=dp;i++){
        nizp[i]--;
      }
      for(int i=dy;i<=dn;i++){
        nizn[i]--;
      }
      if(nizp[dx]==0 && dx<=dp){
        cout<<d<<endl;
        for(int i=1;i<=d;i++){
          cout<<res[i];
        }
        br++;
        cout<<endl;
        break;
      }
      if(nizn[dy]==0 && dy<=dn){
        cout<<d<<endl;
        for(int i=1;i<=d;i++){
          cout<<res[i];
        }
        cout<<endl;
        br++;
        break;
      }
    }
    if(d==n && br==0){
      cout<<n<<endl;
      for(int i=1;i<=n;i++){
          cout<<res[i];
        }
      cout<<endl;
    }
  }
  return 0;
}