#include <bits/stdc++.h>
using namespace std;
int a[205], b[205], c[205];
int n;
int main() {
  cin >> n;
  n *= 2;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c[a[i]]++;
  }
  int x = 0, y = 0;
  for (int i = 10; i <= 100; i++) {
    if (c[i] == 1) {
      x++;
    } else if (c[i] > 1) {
      y++;
    }
  }
  printf("%d\n", (x / 2 + y) * (x - x / 2 + y));
  bool flag = 0;
  for (int i = 1; i <= n; i++) {
    if (c[a[i]] == 1) {
      b[i] = flag;
      flag ^= 1;
    }
  }
  for (int i = 10; i <= 100; i++) {
    if (c[i] > 1) {
      for (int j = 1; j <= n; j++) {
        if (a[j] == i) {
          b[j] = flag;
          flag ^= 1;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", b[i] + 1);
  }
}
