#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int PRIME = 999983;
const int MOD = 10007;
const int MULTI = 1000000007;
const double EPS = 1e-9;
int x[256], sum[128], blg[128];
int main() {
  int n, cnt = 0, m = 0;
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; i++) scanf("%d", &x[i]), sum[x[i]]++;
  for (int i = 10; i <= 99; i++)
    if (sum[i] == 1) cnt++;
  m = cnt /= 2;
  for (int i = 10; i <= 99; i++)
    if (sum[i] == 1 && cnt) blg[i]++, cnt--, sum[i]--;
  for (int i = 10; i <= 99; i++)
    if (sum[i] >= 2)
      blg[i] += sum[i] / 2, m += sum[i] / 2, sum[i] -= sum[i] / 2;
  if (m < n) {
    m = n - m;
    for (int i = 10; m && i <= 99; i++)
      if (sum[i] > 1) {
        int t = min(m, sum[i] - 1);
        m -= t, blg[i] += t, sum[1] -= t;
      }
  }
  int a = 0, b = 0;
  for (int i = 10; i <= 99; i++)
    if (sum[i]) a++;
  for (int i = 10; i <= 99; i++)
    if (blg[i]) b++;
  printf("%d\n", a * b);
  for (int i = 0; i < 2 * n; i++)
    if (blg[x[i]])
      printf("1 "), blg[x[i]]--;
    else
      printf("2 ");
  puts("");
  return 0;
}
