#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > v, rem;
int ans[500];
int main() {
  int i, j, k, l, test, t = 1;
  scanf("%d", &n);
  n *= 2;
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    v.push_back(make_pair(k, i));
  }
  sort(v.begin(), v.end());
  int last = -1, c = 0, curr = 1;
  int c1 = 0, c2 = 0;
  for (i = 0; i < v.size(); i++) {
    int now = v[i].first;
    if (now == last) {
      c++;
    } else
      c = 1;
    if (c > 2) {
      rem.push_back(v[i]);
      continue;
    }
    last = now;
    ans[v[i].second] = curr;
    if (curr == 1)
      c1++;
    else
      c2++;
    curr = 3 - curr;
  }
  for (i = 0; i < rem.size(); i++) {
    ans[rem[i].second] = curr;
    curr = 3 - curr;
  }
  printf("%d\n", c1 * c2);
  for (i = 1; i <= n; i++) {
    if (i > 1) printf(" ");
    printf("%d", ans[i]);
  }
  puts("");
  return 0;
}
