#include <bits/stdc++.h>
using namespace std;
int hp[200];
int df[2];
int main() {
  int n;
  while (cin >> n) {
    df[0] = df[1] = 0;
    stack<int> num[101];
    for (int i = 0; i < 2 * n; i++) {
      int tem;
      cin >> tem;
      num[tem].push(i);
    }
    int x = 0, y = 0;
    for (int i = 10; i <= 99; i++) {
      if (num[i].size() == 1) {
        int id = num[i].top();
        num[i].pop();
        hp[id] = x;
        df[x]++;
        x = (x + 1) % 2;
      }
    }
    for (int i = 0; i <= 99; i++) {
      if (num[i].size() >= 2) {
        df[0]++;
        df[1]++;
        while (!num[i].empty()) {
          int id = num[i].top();
          num[i].pop();
          hp[id] = x;
          x = (x + 1) % 2;
        }
      }
    }
    cout << df[0] * df[1] << endl;
    for (int i = 0; i < 2 * n; i++) cout << hp[i] + 1 << " ";
    cout << endl;
  }
  return 0;
}
