#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int cnt[2];
int a[205], vis[205], num[205];
int v[205], s[205], x[205];
int main() {
  int i, j, t, p, q;
  while (~scanf("%d", &n)) {
    memset(vis, 0, sizeof(vis));
    memset(num, 0, sizeof(num));
    for (i = 1; i <= 2 * n; i++) {
      scanf("%d", &a[i]);
      vis[a[i]]++;
    }
    cnt[0] = cnt[1] = 0;
    p = 0;
    for (i = 10; i < 100; i++) {
      if (vis[i] == 0) continue;
      if (vis[i] == 1)
        cnt[p]++, p = p ^ 1;
      else
        cnt[0]++, cnt[1]++;
    }
    ans = cnt[0] * cnt[1];
    memset(s, 0, sizeof(s));
    memset(v, 0, sizeof(v));
    memset(x, 0, sizeof(x));
    p = 0;
    q = 1;
    printf("%d\n", ans);
    for (i = 1; i < 2 * n; i++) {
      if (vis[a[i]] == 1) {
        printf("%d ", p + 1);
        p ^= 1;
      } else if (vis[a[i]] & 1) {
        if (!v[a[i]])
          v[a[i]] = 1, s[a[i]] = q, q = q ^ 1;
        else
          s[a[i]] ^= 1;
        printf("%d ", s[a[i]] + 1);
      } else {
        printf("%d ", x[a[i]] + 1);
        x[a[i]] ^= 1;
      }
    }
    if (vis[a[i]] == 1) {
      printf("%d\n", p + 1);
      p ^= 1;
    } else if (vis[a[i]] & 1) {
      if (!v[a[i]])
        v[a[i]] = 1, s[a[i]] = q, q = q ^ 1;
      else
        s[a[i]] ^= 1;
      printf("%d\n", s[a[i]] + 1);
    } else {
      printf("%d\n", x[a[i]] + 1);
      x[a[i]] ^= 1;
    }
  }
  return 0;
}
