#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, x, l = 0, r = 0;
  vector<deque<int> > coll(100);
  cin >> n;
  vector<int> ans(2 * n, 3);
  for (i = 0; i < 2 * n; i++) {
    cin >> x;
    coll[x].push_back(i);
  }
  for (i = 10; i <= 99; i++) {
    if (coll[i].size() >= 2) {
      l++;
      r++;
      ans[*(coll[i].begin())] = 1;
      ans[*(++(coll[i].begin()))] = 2;
      coll[i].pop_front();
      coll[i].pop_front();
    } else if (coll[i].size() == 1) {
      if (l <= r) {
        l++;
        ans[*(coll[i].begin())] = 1;
        coll[i].pop_front();
      } else {
        r++;
        ans[*(coll[i].begin())] = 2;
        coll[i].pop_front();
      }
    }
  }
  int t = 0, e1 = 0, e2 = 0;
  for (i = 0; i < 2 * n; i++) {
    if (ans[i] == 1) e1++;
    if (ans[i] == 2) e2++;
  }
  cout << e1 * e2 << "\n";
  for (i = 0; i < 2 * n; i++) {
    if (ans[i] == 3) {
      t++;
      if (t % 2 == 1)
        ans[i] = 2;
      else
        ans[i] = 1;
    }
  }
  for (i = 0; i < 2 * n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
