#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

int main()
{
	int n;
	std::cin >> n;

	std::vector<int> jug;
	std::vector<int> sever;

	for (int i = 0; i < n; i++)
	{
		int temp;
		std::cin >> temp;

		if (temp > 0)
			sever.push_back(temp);
		else
			jug.push_back(-temp);
	}

	std::sort(sever.begin(), sever.end());
	std::sort(jug.begin(), jug.end());

	sever.push_back(-1);
	jug.push_back(-1);

	int sek = 0;
	int centar = 0;

	int su = 0;
	int ju = 0;

	int potez = 1;

	if (sever[0] < jug[0])
	{
		potez = 1;
		su++;
	}
	else
	{
		potez = 2;
		ju++;
	}

	std::string s;

	int geknuli = 0;

	while (sek < 1000000)
	{
		s += std::to_string(potez);

		if (potez == 1 || potez == 3)
		{
			su++;
			potez = 2;
		}
		else if (potez == 2 || potez == 3)
		{
			if (potez == 2 && jug[ju] - sek == -centar + 1)
			{
				centar++;
				potez = 3;
				break;
			}

			ju++;
			potez = 1;
		}

		if (su > sever.size() - 1)
			su = sever.size() - 1;
		if (ju > jug.size() - 1)
			ju = jug.size() - 1;

		geknuli = su + ju;

		if (sever[su] - sek == centar + 1 || jug[ju] - sek == -centar + 1)
		{
			break;
		}

		if (su == sever.size() - 1 && ju == jug.size() - 1)
			break;

		sek++;
	}

	std::cout << geknuli << "\n";
	std::cout << s;
}