// PetarR57.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>

using namespace std;

int main()
{
    //2. zadatak (nedovrsen)-------------------------------------------------------------------
    int n;
    cin >> n;

    vector<int> napred_niz;
    vector<int> nazad_niz;

    for (int i = 0; i < n && i < 1000000; i++) {

        int dementor;
        cin >> dementor;

        if (dementor < 0) nazad_niz.push_back(dementor);
        else if (dementor > 0) napred_niz.push_back(dementor);

    }

    sort(napred_niz.begin(), napred_niz.end());
    sort(nazad_niz.begin(), nazad_niz.end(), [](const int& a, const int& b) {
        return a > b;
    });

    queue<int> napred;
    queue<int> nazad;

    for (int i = 0; i < napred_niz.size(); i++) napred.push(napred_niz[i]);
    for (int i = 0; i < nazad_niz.size(); i++) nazad.push(nazad_niz[i] * (-1));

    int Hari = 0;
    int kada_napred_gadja = 0;
    int kada_nazad_gadja = 0;
    int dodatni_pomeraj = 0;
    int dementori = 0;

    if (napred.empty() || nazad.empty()) {
        if (nazad.empty()) {
            if (napred.front() > 1) {
                cout << napred.size() << "\n";
                for (int i = 0; i < n && i < 1000000; i++) {
                    if (i % 2 == kada_napred_gadja) cout << "1";
                    else cout << "2";
                }
            }

            else cout << "1\n1";

            return 0;
        }
        if (napred.empty()) {
            cout << nazad.size() << "\n";
            for (int i = 0; i < n && i < 1000000; i++) {
                if (i % 2 == kada_nazad_gadja) cout << "2";
                else cout << "3";
            }

            return 0;
        }
    }
    

    else {
        int prosli = 1;
        int minimum = min(napred.front(), nazad.front());

        if (minimum == napred.front()) {
            napred.pop();
            prosli = 1;
        }
        else {
            nazad.pop();
            prosli = 2;
        }

        Hari++;


        for (int i = 1; i < n && i < 1000000; i++) {

            int min_tr = min(napred.front(), nazad.front());

            if (minimum == napred.front()) {
                if (prosli == 1) {
                    nazad.pop();
                    prosli = 2;
                }
                else {
                    napred.pop();
                    prosli = 1;
                }
            }
            else {
                if (prosli == 2) {

                }
                else {
                    nazad.pop();
                    prosli = 2;
                }
            }


            Hari++;
        }

    }

}
//1 100/100
/*
    //1.ZADATAK --------------------------------------------------------------------------------------
    int t;
    cin >> t;
    vector<pair<int, int>> matrice(t);

    for (int i = 0; i < t; i++) {

        int n;
        int m;

        cin >> n >> m;
        matrice[i] = make_pair(n, m);
    }

    for (int i = 0; i < t; i++) {

        int n = matrice[i].first;
        int m = matrice[i].second;

        if (n != m) cout << "-1 ";
        else {

            for (int i = 0; i < m; i++) cout << "1 ";
            cout << '\n';

            for (int i = 1; i < n - 1; i++) {
                cout << "1 ";
                for (int j = 1; j < m - i; j++) {
                    cout << "0 ";
                }

                for (int j = m - i; j < m; j++) {
                    cout << "1 ";
                }
                cout << "\n";
            }


            for (int i = 0; i < m; i++) cout << 1 << " ";
            cout << '\n';
        }

        cout << "\n";
        //1.ZADATAK -------------------------------------------------------------------------------------- KRAJ ------------------------------------------------------
    }
    */
//2 0/100
/*
        //2. zadatak (nedovrsen)-------------------------------------------------------------------
        int n;
        cin >> n;

        vector<int> napred_niz;
        vector<int> nazad_niz;

        for (int i = 0; i < n && i < 1000000; i++) {

            int dementor;
            cin >> dementor;

            if (dementor < 0) nazad_niz.push_back(dementor);
            else if (dementor > 0) napred_niz.push_back(dementor);

        }

        sort(napred_niz.begin(), napred_niz.end());
        sort(nazad_niz.begin(), nazad_niz.end(), [](const int& a, const int& b) {
            return a > b;
        });

        queue<int> napred;
        queue<int> nazad;

        for (int i = 0; i < napred_niz.size(); i++) napred.push(napred_niz[i]);
        for (int i = 0; i < nazad_niz.size(); i++) nazad.push(nazad_niz[i]);

        if (napred.front() == (-1) * nazad.front() && napred.front() == 1) {
            cout << "1\n";
            cout << "1";
            return 0;
        }

        int byebye_dementors = 0;
        cout << byebye_dementors << "\n";
        bool potez1_aktivan = true;
        bool potez2_aktivan = true;
        bool potez3_aktivan = true;

        for (int i = 0; i < n && i < 1000000; i++) {

            if (potez1_aktivan && (nazad.empty() || (!napred.empty() && napred.front() <= (-1) * nazad.front()))) {
                cout << "1";
                napred.pop();
            }

            else if (potez2_aktivan && (napred.empty() || (!nazad.empty() && (-1) * nazad.front() < napred.front()))) {
                cout << "2";
                nazad.pop();
            }

            potez1_aktivan = !potez1_aktivan;
            potez2_aktivan = !potez2_aktivan;
            potez3_aktivan = !potez3_aktivan;
        }
        //-------------------------------------------------------------------------------
        */