#include <bits/stdc++.h>
using namespace std;
int n, a[222], cnt[100], cnt1 = 0, cnt2 = 0, use[100], sol[222];
int main() {
  scanf("%d", &n);
  n = n * 2;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    cnt[a[i]]++;
  }
  for (int i = 10; i <= 99; i++) {
    if (cnt[i] >= 2)
      cnt2++;
    else if (cnt[i] == 1)
      cnt1++;
  }
  int ans = (cnt2 + (cnt1 / 2)) * (cnt2 + (cnt1 - cnt1 / 2));
  int size1 = 0, temp = 0;
  for (int i = 0; i < n; i++) {
    if (cnt[a[i]] >= 2 && use[a[i]] < 2) {
      use[a[i]]++;
      sol[i] = use[a[i]];
      if (sol[i] == 1) size1++;
    } else if (cnt[a[i]] == 1) {
      if (temp < cnt1 / 2) {
        sol[i] = 1;
        temp++;
        size1++;
      } else {
        sol[i] = 2;
      }
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < n; i++) {
    if (sol[i] != 0)
      printf("%d ", sol[i]);
    else {
      if (size1 < n / 2) {
        printf("1 ");
        size1++;
      } else
        printf("2 ");
    }
  }
  return 0;
}
