#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, ANS[210];
  vector<int> cnt[110], h[2];
  cin >> n;
  for (int i = 0; i < 2 * n; ++i) {
    cin >> a;
    cnt[a].push_back(i);
  }
  int f = 0;
  for (int i = 10; i < 100; ++i) {
    if ((cnt[i].size() & 1) && cnt[i].size() > 1) {
      for (int j = 0; j < cnt[i].size(); ++j) {
        ANS[cnt[i][j]] = f + 1;
        h[f].push_back(i);
        f ^= 1;
      }
      cnt[i].clear();
    }
  }
  for (int i = 10; i < 100; ++i) {
    if (cnt[i].size()) {
      for (int j = 0; j < cnt[i].size(); ++j) {
        ANS[cnt[i][j]] = f + 1;
        h[f].push_back(i);
        f ^= 1;
      }
      cnt[i].clear();
    }
  }
  int hash[10000] = {0}, CNT = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (hash[h[0][i] * 100 + h[1][j]] == 0) CNT++;
      hash[h[0][i] * 100 + h[1][j]] = 1;
    }
  cout << CNT << endl;
  for (int i = 0; i < 2 * n; ++i) cout << ANS[i] << ' ';
  return 0;
}
