using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] niz = new int[n];
            string[] unos = Console.ReadLine().Split();
            List<int> levi = new List<int>();
            List<int> desni = new List<int>();
            List<int> potezi = new List<int>();
            int br = 0;
            for (int i = 0; i < n; i++)
            {
                niz[i] = int.Parse(unos[i]);

                if (niz[i] < 0)
                {
                    levi.Add(niz[i]);
                }
                else
                {
                    desni.Add(niz[i]);
                }
            }
            bool ziv = true;
            desni.Sort();
            levi.Sort();
            int put = 0;
            while (ziv || br == n)
            {
                if (put > 0)
                {
                    for (int i = 0; i < desni.Count; i++)
                    {
                        desni[i]++;
                    }
                    for (int j = 0; j < levi.Count; j++)
                    {
                        levi[j]++;
                    }
                }
                int a = levi.Count - 1;
                if (levi[a] == 0 || desni[0] == 0)
                {
                    ziv = false;
                    break;
                }
                else if (Math.Abs(levi[a]) > desni[0])
                {
                    potezi.Add(2);
                    br++;
                    levi.Remove(levi[a]);
                }
                else
                {
                    potezi.Add(1);
                    br++;
                    desni.Remove(desni[0]);
                }
                put++;


            }
            Console.WriteLine(br);
            for (int i = 0; i < potezi.Count; i++)
            {
                Console.Write(potezi[i]);
            }
        }
    }
}