#include <bits/stdc++.h>
using namespace std;
namespace {
const double PI = acos(-1.0);
}
struct Data {
  int n;
  int c;
  vector<int> t;
  Data() : c(0) {}
  bool operator<(const Data& d) const { return c < d.c; }
};
int main() {
  int n;
  while (cin >> n) {
    n *= 2;
    Data d[101];
    for (int i = 0; i < n; ++i) {
      int x;
      cin >> x;
      d[x].n = x;
      ++d[x].c;
      d[x].t.push_back(i);
    }
    sort(d, d + 101);
    bool f = 0;
    vector<int> ans[2];
    set<int> s[2];
    int z[101] = {0};
    for (int i = 0; i < 101; ++i) {
      for (int j = 0; j < d[i].c; ++j) {
        ans[f].push_back(d[i].n);
        s[f].insert(d[i].n);
        z[d[i].t[j]] = f;
        f = !f;
      }
    }
    cout << s[0].size() * s[1].size() << endl;
    for (int i = 0; i < n; ++i) {
      if (i) cout << " ";
      cout << z[i] + 1;
    }
    cout << endl;
  }
  return 0;
}
