#include <bits/stdc++.h>
using namespace std;
int n;
int A[200];
int B[100];
int main() {
  scanf("%d", &n);
  int x = 0;
  for (int i = 0; i < 100; i++) B[i] = 0;
  for (int i = 0; i < 2 * n; i++) {
    scanf("%d", &A[i]);
    if (B[A[i]] < 2) {
      B[A[i]]++;
      x++;
    }
  }
  int t = x / 2;
  int s = x - t;
  int res = t * s;
  int t1 = n - t;
  printf("%d\n", res);
  for (int i = 0; i < 2 * n; i++) {
    if (B[A[i]] == 2) {
      B[A[i]] = 3;
      A[i] = 1;
      t--;
    }
  }
  for (int i = 0; i < 2 * n; i++) {
    if (B[A[i]] == 3) {
      B[A[i]] = 0;
      A[i] = 2;
    }
  }
  for (int i = 0; i < 2 * n; i++) {
    if (B[A[i]] == 1 && t > 0) {
      B[A[i]] = 0;
      A[i] = 1;
      t--;
    }
  }
  for (int i = 0; i < 2 * n; i++) {
    if (B[A[i]] == 0 && t1 > 0 && A[i] > 9) {
      A[i] = 1;
      t1--;
    } else if (A[i] > 9) {
      A[i] = 2;
    }
  }
  for (int i = 0; i < 2 * n; i++) {
    printf("%d ", A[i]);
  }
}
