#include <bits/stdc++.h>
using namespace std;
const int maxn = 210;
int pos[maxn];
int f[maxn];
int sum[maxn];
int first[maxn];
int main() {
  int n;
  scanf("%d", &n);
  int heap1 = n;
  int heap2 = n;
  int temp = 1;
  int t1 = n;
  int t2 = n;
  for (int i = 1; i <= 2 * n; i++) {
    scanf("%d", &f[i]);
    sum[f[i]]++;
    if (sum[f[i]] == 1) first[f[i]] = i;
    if (sum[f[i]] == 2) {
      pos[i] = 2;
      heap2--;
      pos[first[f[i]]] = 1;
      heap1--;
    }
    if (sum[f[i]] >= 3) {
      if (temp == 1) {
        pos[i] = 1;
        heap1--;
        t1--;
        temp = 2;
      } else {
        pos[i] = 2;
        heap2--;
        t2--;
        temp = 1;
      }
    }
  }
  for (int i = 1; i <= 2 * n; i++) {
    if (pos[i] == 0) {
      if (heap1) {
        pos[i] = 1;
        heap1--;
      } else {
        pos[i] = 2;
      }
    }
  }
  printf("%d\n", t1 * t2);
  for (int i = 1; i <= 2 * n; i++) {
    printf("%d ", pos[i]);
  }
  return 0;
}
