#include <bits/stdc++.h>
using namespace std;
bool hell(vector<int>& v1, vector<int>& v2) { return v1.size() < v2.size(); }
int main() {
  int n;
  cin >> n;
  vector<vector<int> > f(100);
  int a[2 * n + 1];
  for (int i = 1; i <= 2 * n; i++) {
    cin >> a[i];
    f[a[i]].push_back(i);
  }
  int b[2 * n + 1];
  int u = 1;
  sort(f.begin() + 10, f.end(), hell);
  for (int i = 10; i < 100; i++) {
    for (int j = 0; j < f[i].size(); j++) {
      b[f[i][j]] = u;
      if (u == 1)
        u = 2;
      else
        u = 1;
    }
  }
  int u1 = 0, u2 = 0;
  for (int i = 10; i < 100; i++) {
    if (f[i].size() == 0) {
      continue;
    }
    if (f[i].size() >= 2) {
      u1++;
      u2++;
    } else {
      if (b[f[i][0]] == 1) {
        u1++;
      } else
        u2++;
    }
  }
  cout << (u1 * u2) << endl;
  for (int i = 1; i <= 2 * n; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
