#include <bits/stdc++.h>
using namespace std;
int arr[1000000], ans[1000000], a[2];
stack<int> x[102];
int main() {
  int n, k, aa;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> aa;
    arr[i] = aa;
    x[aa].push(i);
  }
  int itr = 0;
  for (int i = 10; i <= 99; i++) {
    if (x[i].size() == 1) {
      int pos = x[i].top();
      x[i].pop();
      ans[pos] = itr + 1;
      itr = itr + 1;
      itr %= 2;
      a[itr] += 1;
    }
  }
  for (int i = 10; i <= 99; i++) {
    if (x[i].size()) {
      a[0]++;
      a[1]++;
      while (!x[i].empty()) {
        int pos = x[i].top();
        x[i].pop();
        ans[pos] = itr + 1;
        itr += 1;
        itr %= 2;
      }
    }
  }
  cout << a[0] * a[1] << endl;
  for (int i = 0; i < 2 * n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
