#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double eps = 1e-10;
const int MOD = 100000007;
const int MAXN = 1000000;
int num[200], input[200];
map<int, int> s1, s2;
set<int> s;
int fun(int n) {
  if (s1.count(n)) {
    if (--s1[n] == 0) s1.erase(n);
    return 1;
  } else {
    if (--s2[n] == 0) s2.erase(n);
    return 2;
  }
}
int main() {
  int n, t;
  scanf("%d", &n);
  for (int i = 0; i < (2 * n); ++i) {
    scanf("%d", &t);
    input[i] = t;
    num[t]++;
  }
  int cnt = 0;
  for (int i = (10); i <= (99); ++i) {
    if (num[i] > 1) {
      while (num[i] >= 2) {
        s1[i]++;
        s2[i]++;
        num[i] -= 2;
      }
      if (num[i] == 1) {
        if (cnt == 1)
          s2[i]++, cnt--;
        else
          s1[i]++, cnt++;
        num[i]--;
      }
    }
  }
  for (int i = (10); i <= (99); ++i) {
    while (num[i] > 0) {
      if (cnt)
        s2[i]++, cnt--;
      else
        s1[i]++, cnt++;
      num[i]--;
    }
  }
  int c = 0;
  cout << s1.size() * s2.size() << endl;
  cout << fun(input[0]);
  for (int i = (1); i < (2 * n); ++i) {
    cout << " " << fun(input[i]);
  }
  cout << endl;
  return 0;
}
