#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a, flag = 0;
  int c[2] = {0, 0};
  vector<int> v[100];
  cin >> n;
  int b[2 * n];
  for (i = 0; i < 2 * n; i++) {
    cin >> a;
    v[a].push_back(i);
  }
  for (i = 10; i < 100; i++) {
    if (v[i].size() == 1) {
      b[v[i].back()] = flag + 1;
      v[i].pop_back();
      c[flag]++;
      flag = 1 - flag;
    } else if (v[i].size() > 1) {
      while (v[i].size() > 1) {
        b[v[i].back()] = 1;
        v[i].pop_back();
        b[v[i].back()] = 2;
        v[i].pop_back();
      }
      c[0]++;
      c[1]++;
    }
  }
  for (i = 10; i < 100; i++) {
    if (v[i].size() == 1) {
      b[v[i].back()] = flag + 1;
      v[i].pop_back();
      flag = 1 - flag;
    }
  }
  cout << c[0] * c[1] << endl;
  for (i = 0; i < 2 * n; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
