#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int q[2 * n];
  for (int i = 0; i < 2 * n; ++i) {
    scanf("%d", q + i);
  }
  int cnt[100];
  memset((cnt), 0, sizeof(cnt));
  for (int i = 0; i < 2 * n; ++i) cnt[q[i]]++;
  multiset<int> a[2];
  int t = 0;
  for (int i = 10; i < 100; ++i) {
    if (cnt[i] > 1) {
      a[0].insert(i);
      a[1].insert(i);
      cnt[i] -= 2;
      continue;
    }
    if (cnt[i] == 1) {
      a[t].insert(i);
      cnt[i]--;
      t ^= 1;
    }
  }
  for (int i = 10; i < 100; ++i) {
    while (cnt[i] > 0) {
      --cnt[i];
      a[t].insert(i);
      t ^= 1;
    }
  }
  set<int> b[2];
  b[0] = set<int>(a[0].begin(), a[0].end());
  b[1] = set<int>(a[1].begin(), a[1].end());
  cout << b[0].size() * b[1].size() << endl;
  for (int i = 0; i < 2 * n; ++i) {
    if (i) cout << " ";
    if (a[0].count(q[i])) {
      cout << "1";
      a[0].erase(a[0].find(q[i]));
    } else {
      cout << "2";
      a[1].erase(a[1].find(q[i]));
    }
  }
  cout << endl;
  return 0;
}
