#include <bits/stdc++.h>
using namespace std;
int n, ans[100010];
queue<int> c[110];
int num[3];
int main() {
  scanf("%d", &n);
  n *= 2;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    c[x].push(i);
  }
  int k = 1;
  for (int i = 10; i < 100; i++) {
    if (c[i].size() >= 2) {
      ans[c[i].front()] = 1;
      c[i].pop();
      ans[c[i].front()] = 2;
      c[i].pop();
      num[1]++, num[2]++;
    } else if (c[i].size() >= 1) {
      ans[c[i].front()] = k;
      num[k]++;
      c[i].pop();
      k = k % 2 + 1;
    }
  }
  printf("%d\n", num[1] * num[2]);
  for (int i = 10; i < 100; i++)
    while (!c[i].empty()) {
      ans[c[i].front()] = k;
      num[k]++;
      c[i].pop();
      k = k % 2 + 1;
    }
  for (int i = 0; i < n; i++) printf("%d%c", ans[i], i == n - 1 ? '\n' : ' ');
  return 0;
}
