#include <bits/stdc++.h>
using namespace std;
const int N = 200 + 19;
vector<int> V[N];
int n, t, Ca, Cb, x, f, Ans[N];
int main() {
  scanf("%d", &n);
  n *= 2;
  for (int i = 0; i < n; i++) scanf("%d", &x), V[x].push_back(i);
  for (int i = 10; i < 100; i++) {
    if ((t = V[i].size()) >= 2)
      Ca++, Cb++;
    else
      continue;
    for (; t >= 2; t -= 2)
      Ans[V[i].back()] = 1, V[i].pop_back(), Ans[V[i].back()] = 2,
      V[i].pop_back();
    if (t) Ans[V[i].back()] = f ? 1 : 2, V[i].pop_back(), f ^= 1;
  }
  for (int i = 10; i < 100; i++)
    if (V[i].size()) Ans[V[i].back()] = f ? (Ca++, 1) : (Cb++, 2), f ^= 1;
  printf("%d\n", Ca * Cb);
  for (int i = 0; i < n; i++) printf("%d ", Ans[i]);
  puts("");
}
