#include <bits/stdc++.h>
using namespace std;
int z, cnt[100], n, quan[2], x = 1, y = 2, num_res[200];
int main() {
  scanf("%d", &n);
  int a[2 * n];
  for (int i = 0; i < 2 * n; i++) scanf("%d", &a[i]), cnt[a[i]]++;
  for (int i = 0; i < 2 * n; i++)
    if (cnt[a[i]] > 1) cnt[a[i]] = 2;
  for (int i = 0; i < 2 * n; ++i) {
    if (cnt[a[i]] == 1) {
      num_res[i] = x % 2;
      ++quan[x % 2];
      ++x;
    }
    if (cnt[a[i]] == 4) num_res[i] = y % 2, ++y;
    if (cnt[a[i]] == 3) {
      num_res[i] = 1;
      ++quan[1];
      cnt[a[i]] = 4;
    }
    if (cnt[a[i]] == 2) {
      num_res[i] = 0;
      ++quan[0];
      cnt[a[i]] = 3;
    }
  }
  printf("%d\n", quan[0] * quan[1]);
  for (int i = 0; i < 2 * n; i++) printf("%d ", ++num_res[i]);
}
