using System;
using System.Linq;
using System.Collections.Generic;
static void Main(){
//drugi zadatak
int n = int.Parse(Console.ReadLine());
List<int> poz = new();
List<int> neg = new();
string[] s = Console.ReadLine().Split();
for (int i = 0; i < n; i++){
    if (int.Parse(s[i])<0) neg.Add(i);
    else poz.Add(i);
}
poz.Sort();
neg.Sort();
int brmaxpoteza = 1000000;
int d = 0;
int[] potez = new int[brmaxpoteza];
bool jug = false;                                                                                                                                   //
bool sever = false;
int h = 0;
int br = 0;
for (int i = 0; i < brmaxpoteza; i++)
{
    if (neg == null && poz == null) break;
    if (neg!=null && Math.Abs(neg[br]) <= poz[br] && !jug) {                                                            //ja sam debil 
        potez[br] += 2; 
        d++; 
        jug = true; sever = false;
        neg.Remove(br);
    }
    else if (poz!=null && poz[br] < Math.Abs(neg[br]) && !sever){
        potez[br] += 1;
        d++;
        sever = true;
        jug= false;
        poz.Remove(br);
    }
    //ubicu seeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    br++;
    
}
Console.WriteLine(d);
Console.WriteLine(potez);
}