#include <bits/stdc++.h>
using namespace std;
template <class _Tp>
void ckmax(_Tp &a, _Tp b) {
  if (a < b) a = b;
}
template <class _Tp>
void ckmin(_Tp &a, _Tp b) {
  if (a > b) a = b;
}
template <class _Tp>
_Tp gcd(_Tp a, _Tp b) {
  return (b == 0) ? (a) : (gcd(b, a % b));
}
int read() {
  char ch = getchar();
  bool f = 1;
  int x = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') f = 0, ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch & 15);
    ch = getchar();
  }
  return f ? x : -x;
}
const int inf = 1000000000;
const long long Inf = 1000000000000000000ll;
int ans[205], n, sum1, sum2;
bool vis1[205], vis2[205];
vector<int> p[205];
int main() {
  n = read();
  for (int i = 0, x; i < 2 * n; ++i) {
    x = read();
    p[x].push_back(i);
  }
  int a = 1;
  for (int k = 0; k < 2; ++k)
    for (int i = 0; i < 111; ++i)
      for (int j = (!k) ? 0 : 2; j < p[i].size() && ((!k) ? j < 2 : 1); ++j) {
        ans[p[i][j]] = a;
        if (a == 1)
          vis1[i] ? 0 : (++sum1, vis1[i] = 1);
        else
          vis2[i] ? 0 : (++sum2, vis2[i] = 1);
        a = 3 - a;
      }
  printf("%d\n", sum1 * sum2);
  for (int i = 0; i < 2 * n; ++i) printf("%d ", ans[i]);
  return 0;
}
