#include <bits/stdc++.h>
using namespace std;
set<int> s[3];
int res[1000], n, a;
vector<int> v[1000];
int main() {
  cin >> n;
  n = n * 2;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v[a].push_back(i);
  }
  a = 1;
  for (int k = 0; k < 2; k++)
    for (int i = 0; i < 111; i++)
      for (int j = (!k) ? 0 : 2; j < v[i].size() && ((!k) ? j < 2 : 1); j++) {
        res[v[i][j]] = a;
        s[a].insert(i);
        a = 3 - a;
      }
  cout << s[1].size() * s[2].size() << endl;
  for (int i = 0; i < n; i++) cout << res[i] << " ";
}
