#include <bits/stdc++.h>
using namespace std;
int ans[233], mp[233] = {0};
int a[233];
queue<int> q[133];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n; i++) {
    scanf("%d", &a[i]);
    q[a[i]].push(i);
    mp[a[i]]++;
  }
  int flag = 0, cnt1 = 0, cnt2 = 0;
  int heap1 = 0, heap2 = 0;
  for (int i = 10; i <= 99; i++) {
    if (mp[i] == 2) {
      cnt1++;
      cnt2++;
      heap1++;
      heap2++;
      mp[i] -= 2;
      ans[q[i].front()] = 1;
      q[i].pop();
      ans[q[i].front()] = 2;
      q[i].pop();
    } else if (mp[i] == 1) {
      mp[i]--;
      if (flag == 0)
        cnt1++, flag = 1, ans[q[i].front()] = 1, heap1++;
      else
        cnt2++, flag = 0, ans[q[i].front()] = 2, heap2++;
    }
  }
  for (int i = 10; i <= 99; i++) {
    if (mp[i]) {
      cnt1++, cnt2++;
      while (!q[i].empty()) {
        if (heap1 > heap2)
          ans[q[i].front()] = 2, q[i].pop(), heap2++;
        else if (heap1 == heap2)
          ans[q[i].front()] = 1, q[i].pop(), heap1++;
        else if (heap1 < heap2)
          ans[q[i].front()] = 1, q[i].pop(), heap1++;
      }
    }
  }
  printf("%d\n", cnt1 * cnt2);
  for (int i = 1; i <= 2 * n; i++) {
    if (i == 2 * n)
      printf("%d\n", ans[i]);
    else
      printf("%d ", ans[i]);
  }
  return 0;
}
