#include <bits/stdc++.h>
using namespace std;
const int maxn = 205, INF = 0x3f3f3f3f;
int check[maxn], num[maxn], turn[maxn], ans[maxn];
int main() {
  int n, dn, i, j, sum1 = 0, sum2 = 0;
  scanf("%d", &n);
  dn = n << 1;
  for (i = 0; i < dn; i++) {
    scanf("%d", &num[i]);
    check[num[i]]++;
  }
  for (i = 0; i < maxn; i++) {
    if (check[i] > 0) {
      if (check[i] < 2)
        sum2 < sum1 ? sum2++ : sum1++;
      else
        sum1++, sum2++;
    }
  }
  printf("%d\n", sum1 * sum2);
  for (i = 0; i < dn; i++) {
    if (check[num[i]] <= 1) {
      if (sum2 < sum1)
        sum2++, ans[i] = 2;
      else
        sum1++, ans[i] = 1;
    }
  }
  sum1 = sum2 = 0;
  for (i = 0; i < dn; i++) {
    if (check[num[i]] > 1) {
      if (turn[num[i]] == 0)
        sum1++, ans[i] = 1, turn[num[i]]++;
      else if (turn[num[i]] == 1)
        sum2++, ans[i] = 2, turn[num[i]]++;
    }
  }
  for (i = 0; i < dn; i++) {
    if (!ans[i]) {
      if (sum2 < sum1)
        sum2++, ans[i] = 2, turn[num[i]]++;
      else
        sum1++, ans[i] = 1, turn[num[i]]++;
    }
  }
  for (i = 0; i < dn - 1; i++) printf("%d ", ans[i]);
  printf("%d\n", ans[i]);
  return 0;
}
