#include <bits/stdc++.h>
using namespace std;
int count1[101], num[201];
int main() {
  int n, a[202];
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> a[i];
    count1[a[i]]++;
  }
  int s1 = 0, s2 = 0, t = 1;
  for (int i = 10; i <= 99; i++) {
    if (count1[i] > 0) {
      int k = 0;
      for (int j = 0; j < 2 * n; j++)
        if (a[j] == i) {
          k++;
          num[j] = t;
          if (t == 1)
            s1++;
          else
            s2++;
          t = (t == 1) ? 2 : 1;
          if (k == 2) break;
        }
    }
  }
  cout << s1 * s2 << endl;
  int u = n - s1;
  int ind = 0;
  while (u > 0) {
    if (num[ind] == 0) {
      num[ind] = 1;
      u--;
    }
    ind++;
  }
  u = n - s2;
  ind = 0;
  while (u > 0) {
    if (num[ind] == 0) {
      num[ind] = 2;
      u--;
    }
    ind++;
  }
  for (int i = 0; i < 2 * n; i++) cout << num[i] << " ";
  return 0;
}
