#include <bits/stdc++.h>
using namespace std;
int a[205], b[205], num[205], vis[205], n, num0, num1, num2;
int main() {
  scanf("%d", &n);
  n <<= 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    num[a[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (num[a[i]] >= 2) {
      if (!vis[a[i]]) {
        num0++;
        b[i] = vis[a[i]] = 1;
      } else if (vis[a[i]] == 1)
        b[i] = vis[a[i]] = 2;
    } else if (num1 > num2) {
      b[i] = 2;
      num2++;
    } else {
      b[i] = 1;
      num1++;
    }
  }
  num1 += num0;
  printf("%d\n", num1 * (num2 + num0));
  for (int i = 1; i <= n; i++)
    if (vis[a[i]] == 2 && !b[i]) {
      if (num1 < (n >> 1)) {
        b[i] = 1;
        num1++;
      } else
        b[i] = 2;
    }
  for (int i = 1; i <= n; i++) printf("%d ", b[i]);
}
