#include <bits/stdc++.h>
using namespace std;
const int N = 111;
vector<pair<int, int> > a;
int ans[N * 2];
bool st1[N], st2[N], st[2 * N];
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= 2 * n; ++i) {
    scanf("%d", &j);
    a.push_back(make_pair(j, i));
  }
  sort(a.begin(), a.end());
  int cnt1 = 0, cnt2 = 0;
  for (i = 0; i < 2 * n;) {
    if (i < 2 * n - 1 && a[i].first == a[i + 1].first) {
      cnt1++;
      cnt2++;
      st[i] = st[i + 1] = true;
      ans[a[i].second] = 1;
      ans[a[i + 1].second] = 2;
      st1[a[i].first] = st2[a[i].first] = true;
      while (i < 2 * n - 1 && a[i].first == a[i + 1].first) i++;
    }
    i++;
  }
  for (i = 0; i < 2 * n; ++i) {
    if (i < 2 * n - 1 && a[i].first == a[i + 1].first)
      while (i < 2 * n - 1 && a[i].first == a[i + 1].first) i++;
    else {
      ans[a[i].second] = (cnt1 <= cnt2 ? (st1[a[i].first] = true, ++cnt1, 1)
                                       : (st2[a[i].first] = true, ++cnt2, 2));
      st[i] = true;
    }
  }
  for (i = 0; i < 2 * n; ++i)
    if (!st[i]) {
      ans[a[i].second] = (cnt1 <= cnt2 ? (st1[a[i].first] = true, ++cnt1, 1)
                                       : (st2[a[i].first] = true, ++cnt2, 2));
    }
  int s1 = 0, s2 = 0;
  for (i = 10; i <= 99; ++i) {
    s1 += st1[i];
    s2 += st2[i];
  }
  printf("%d\n", s1 * s2);
  for (i = 1; i <= 2 * n; ++i) printf("%d%c", ans[i], i == 2 * n ? '\n' : ' ');
  return 0;
}
