using System;
using System.Collections.Generic;
using System.Text;

public class Program
{
    public static void Main(string[] args)
    {


        int n = int.Parse(Console.ReadLine());

        string input = Console.ReadLine();

        string[] inputs = input.Split(' ');

        List<int> mins = new List<int>();
        List<int> pluss = new List<int>();

        for (int i = 0; i < n; i++)
        {
            int x = int.Parse(inputs[i]);
            if (x < 0) mins.Add(x);
            else pluss.Add(x);
        }

        mins.Sort((a, b) => b.CompareTo(a));
        pluss.Sort();

        int ni = 0;
        int pi = 0;
        int pozicija = 0;
        int time = 0;
        StringBuilder count = new StringBuilder();
        int dont = 0;

        while (count.Length < 1000000)
        {
            int distNeg;
            if ((ni < mins.Count))
            {
                distNeg = (pozicija - mins[ni] - time);
            }
            else
            {
                distNeg = int.MaxValue;
            }

            int distPos;
            if ((pi < pluss.Count))
            {
                distPos = (pluss[pi] - pozicija - time);
            }
            else
            {
                distPos = int.MaxValue;
            }

            if (distNeg <= 0 || distPos <= 0) break;

            if (distPos == 1 && distNeg == 1)
            {
                count.Append('1');
                pi++;
                dont++;
                break;
            }
            else if (distPos == 1)
            {
                count.Append('1');
                pi++;
                dont++;
            }
            else if (distNeg == 1)
            {
                count.Append('2');
                ni++;
                dont++;
            }
            else
            {
                if (pi == pluss.Count && ni < mins.Count)
                {
                    count.Append('3');
                    pozicija++;
                }
                else if (ni == mins.Count && pi < pluss.Count)
                {
                    count.Append('1');
                    pi++;
                    dont++;
                }
                else if (ni < mins.Count && pi < pluss.Count)
                {
                    if (distPos <= distNeg)
                    {
                        count.Append('1');
                        pi++;
                    }
                    else
                    {
                        count.Append('2');
                        ni++;
                    }
                    dont++;
                }
                else
                {
                    break;
                }
            }
            time++;
        }

        Console.WriteLine(dont);
        Console.WriteLine(count.ToString());
    }
}