#include <bits/stdc++.h>
using namespace std;
const long long inf = 1LL << 28;
const long long mod = 1LL;
set<int> s1, s2;
map<int, int> M;
map<int, int>::iterator it;
int ara[1010];
struct data {
  int x, y;
};
data arr[1010];
int main() {
  int i, j, k, n;
  while (scanf("%d", &n) == 1) {
    for (i = 0; i <= 100; i++) arr[i].x = arr[i].y = 0;
    s1.clear();
    s2.clear();
    M.clear();
    for (i = 0; i < 2 * n; i++) {
      scanf("%d", &ara[i]);
      if (M.find(ara[i]) == M.end())
        M[ara[i]] = 1;
      else
        M[ara[i]]++;
    }
    j = k = 0;
    for (it = M.begin(); it != M.end(); it++) {
      if (it->second > 1) {
        if (j < k) {
          s1.insert(it->first);
          if (it->second / 2) s2.insert(it->first);
          j += (it->second / 2) + (it->second % 2);
          k += (it->second / 2);
          arr[it->first].x = (it->second / 2) + (it->second % 2);
          arr[it->first].y = (it->second / 2);
        } else {
          s2.insert(it->first);
          if (it->second / 2) s1.insert(it->first);
          k += (it->second / 2) + (it->second % 2);
          j += (it->second / 2);
          arr[it->first].y = (it->second / 2) + (it->second % 2);
          arr[it->first].x = (it->second / 2);
        }
      }
    }
    for (it = M.begin(); it != M.end(); it++) {
      if (it->second == 1) {
        if (j < k) {
          s1.insert(it->first);
          j++;
          arr[it->first].x = 1;
        } else {
          s2.insert(it->first);
          k++;
          arr[it->first].y = 1;
        }
      }
    }
    printf("%d\n", (int)s1.size() * (int)s2.size());
    for (i = 0; i < 2 * n; i++) {
      if (arr[ara[i]].x != 0)
        arr[ara[i]].x--, printf("1 ");
      else
        arr[ara[i]].y--, printf("2 ");
    }
    printf("\n");
  }
  return 0;
}
