#include <bits/stdc++.h>
using namespace std;
int n;
int a[2 * 100 + 10], pos[2 * 100 + 10];
int sum[100 + 10];
int vis[100 + 10];
int main() {
  cin >> n;
  for (int i = 1; i <= 2 * n; ++i) {
    scanf("%d", a + i);
    sum[a[i]]++;
  }
  int v = 0;
  int cnt[2] = {0, 0};
  for (int i = 10; i <= 99; ++i) {
    if (sum[i] == 1) {
      cnt[v]++;
      v ^= 1;
    } else if (sum[i] > 1) {
      cnt[1]++;
      cnt[0]++;
    }
  }
  int ans = cnt[0] * cnt[1];
  v = 0;
  for (int i = 1; i <= 2 * n; ++i) {
    if (sum[a[i]] == 1) {
      pos[i] = v + 1;
      v ^= 1;
    } else if (sum[a[i]] > 1) {
      vis[a[i]]++;
      if (vis[a[i]] <= 2) {
        if (vis[a[i]] == 1)
          pos[i] = 1;
        else
          pos[i] = 2;
      }
    }
  }
  for (int i = 1; i <= 2 * n; ++i)
    if (!pos[i]) {
      pos[i] = v + 1;
      v ^= 1;
    }
  printf("%d\n", ans);
  cout << pos[1];
  for (int i = 2; i <= 2 * n; ++i) printf(" %d", pos[i]);
  cout << endl;
  return 0;
}
