#include <bits/stdc++.h>
int num[111];
int dat[222];
int n1[111], n2[111];
int h1[111], h2[111];
int p1, p2;
int cnt[11111];
int bl[222];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i != 2 * n; i++) {
    scanf("%d", dat + i);
    num[dat[i]]++;
  }
  for (int i = 0; i != 100; i++) {
    int now = i;
    if (num[now] >= 2) {
      h1[p1++] = now;
      n1[now]++;
      h2[p2++] = now;
      n2[now]++;
      num[now] -= 2;
    }
  }
  for (int i = 0; i != 100; i++) {
    int now = i;
    if (n1[i]) continue;
    if (!num[now]) continue;
    if (p1 < p2) {
      h1[p1++] = now;
      n1[now]++;
    } else {
      h2[p2++] = now;
      n2[now]++;
    }
  }
  printf("%d\n", p1 * p2);
  for (int i = 0; i != 100; i++) {
    int now = n1[i];
    for (int j = 0; now; j++) {
      if (dat[j] == i && bl[j] == 0) {
        bl[j] = 1;
        now--;
      }
    }
    now = n2[i];
    for (int j = 0; now; j++) {
      if (dat[j] == i && bl[j] == 0) {
        bl[j] = 2;
        now--;
      }
    }
  }
  for (int i = 0; i != n * 2; i++) {
    if (bl[i])
      printf("%d ", bl[i]);
    else {
      if (p1 != n) {
        printf("1 ");
        p1++;
      } else
        printf("2 ");
    }
  }
  puts("");
  return 0;
}
