#include <bits/stdc++.h>
using namespace std;
struct cube {
  int ind, val, h;
};
int rcount[101];
int compare1(cube a, cube b) { return a.val < b.val; }
int compare2(cube a, cube b) { return a.ind < b.ind; }
int main() {
  int n;
  scanf("%d", &n);
  vector<cube> v;
  vector<int> one, two;
  for (int i = 0; i < n * 2; i++) {
    cube c;
    c.ind = i;
    c.h = 0;
    scanf("%d", &c.val);
    v.push_back(c);
  }
  sort(v.begin(), v.end(), compare1);
  int size1 = 0, size2 = 0, color = 1, repeat = 0, repeatcount = 0;
  for (int i = 0; i < n * 2; i++) {
    v[i].h = 0;
    if (repeatcount >= 2 && repeat == v[i].val)
      rcount[v[i].val]++;
    else {
      if (repeat == v[i].val)
        repeatcount++;
      else
        repeatcount = 1;
      repeat = v[i].val;
      color *= -1;
      v[i].h = color;
      if (color < 0)
        size1++;
      else
        size2++;
    }
  }
  printf("%d\n", size1 * size2);
  sort(v.begin(), v.end(), compare2);
  for (int i = 0; i < n * 2; i++) {
    if (v[i].h == 0) {
      if (size1 > size2) {
        v[i].h = 1;
        size2++;
      } else {
        v[i].h = -1;
        size1++;
      }
    }
    printf("%d ", (v[i].h < 0) ? 1 : 2);
  }
  return 0;
}
