#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin>>n;
    vector <int> v;
    for (int u=0; u<n; u++) {
        int g;
        cin>>g;
        v.push_back(g);
    }
    vector<int> rez;
    sort (v.begin(), v.end());
    int broj=0;
    int n2=n;
    int d=0;
    int h=0;
    while (n>0) {
            if (v[n2-broj-1]==h-1) {
                rez.push_back(2);
                n--;
                d++;
            }
            else if (v[n2-broj-1]==h+1) {
                n--;
                d++;
                rez.push_back(1);
            }
            else {
                rez.push_back(3);
                h++;
            }
            broj++;
    }
    cout<<d<<endl;
    for (int e=0; e<rez.size(); e++) {
        cout<<rez[e]<<" ";
    }
}