using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
    static void pomeraj(List<int> a, int ph)
    {
        for(int i = 0; i < ph; i++)
        {
            a[i]++;
        }
        for(int i = ph + 1; i < a.Count; i++)
        {
            a[i]--;
        }
    }
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        string[] s = Console.ReadLine().Split();
        List<int> a = new List<int>();
        for (int i = 0; i < n; i++) a.Add(int.Parse(s[i]));
        a.Add(0);
        a.Sort();
        int ph = a.IndexOf(0);
        int bp = 0; int pp = 0;
        if(bp == 7)
        {
            while (bp <= 1000000)
            {
                if (ph > 0 && a[ph - 1] == 0 || ph < a.Count - 1 && a[ph + 1] == 0) break;
                if (ph != 0 && ph != a.Count - 1)
                {
                    if (a[ph] - a[ph - 1] < a[ph + 1] - a[ph] && pp != 2)
                    {
                        Console.Write(2);
                        pp = 2;
                        a.RemoveAt(ph - 1);
                        ph--;
                    }
                    else if (pp != 1)
                    {
                        Console.Write(1);
                        pp = 1;
                        a.RemoveAt(ph + 1);
                    }
                    else
                    {
                        Console.Write(3);
                        pp = 3;
                    }
                }
                else
                {
                    if (ph == 0)
                    {
                        if (pp != 1)
                        {
                            Console.Write(1);
                            pp = 1;
                            a.RemoveAt(ph + 1);
                        }
                        else if (pp != 3)
                        {
                            Console.Write(3);
                            pp = 3;
                        }
                        else
                        {
                            Console.Write(2);
                            pp = 2;
                        }
                    }
                    else
                    {
                        if (pp != 2)
                        {
                            Console.Write(2);
                            pp = 2;
                            a.RemoveAt(ph - 1);
                            ph--;
                        }
                        else if (pp != 3)
                        {
                            Console.Write(3);
                            pp = 3;
                        }
                        else
                        {
                            Console.Write(2);
                            pp = 2;
                        }
                    }
                }
                bp++;
                pomeraj(a, ph);
            }
        }
    }
}