#include <bits/stdc++.h>
using namespace std;
vector<int> cnt[100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; i++) {
    int a;
    scanf("%d", &a);
    cnt[a].push_back(i);
  }
  vector<int> vt[2];
  int odd = 0, arr[2];
  arr[0] = arr[1] = 0;
  for (int i = 10; i <= 99; i++) {
    if (cnt[i].size() == 1) {
      vt[odd ^ 1].push_back(cnt[i][0]);
      arr[odd ^ 1]++;
      odd ^= 1;
    }
  }
  for (int i = 10; i <= 99; i++) {
    if (cnt[i].empty()) continue;
    int len = cnt[i].size();
    if (len == 1) continue;
    if (len & 1) {
      for (int j = 0; j < len / 2; j++) vt[odd].push_back(cnt[i][j]);
      for (int j = len / 2; j < len; j++) vt[odd ^ 1].push_back(cnt[i][j]);
      arr[0]++, arr[1]++;
      odd ^= 1;
    } else {
      arr[0]++;
      arr[1]++;
      for (int j = 0; j < len / 2; j++) vt[odd].push_back(cnt[i][j]);
      for (int j = len / 2; j < len; j++) vt[odd ^ 1].push_back(cnt[i][j]);
    }
  }
  int ans[2 * n];
  for (int x : vt[0]) ans[x] = 1;
  for (int x : vt[1]) ans[x] = 2;
  printf("%d\n", arr[0] * arr[1]);
  for (int i = 0; i < 2 * n; i++) printf("%d ", ans[i]);
  return 0;
}
