#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, x; vector<int> vn, vp; string s; char c;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        if (x < 0) {
            vn.push_back(x);
        }
        else {
            vp.push_back(x);
        }
    }
    x = 0;
    sort (vn.begin(), vn.end(), greater<int>());
    sort (vp.begin(), vp.end());
    if (vn[0] == -1 && vp[0] == 1) {
        cout << 1 << '\n' << 1;
        return 0;
    }
    for (int i = 1; i < n; i++) {
        if (abs(vn[i]) < vp[i]) {
            c = '2';
            s += c;
            d++;
            vn.remove(i);
        }
        else if (vp[i] <= abs(vn[i])) {
            c = '1';
            s += c;
            d++;
            vp.remove(i);
        }
    }
}