#include <bits/stdc++.h>
using namespace std;
int N;
struct Node {
  int num, pos, flag;
} node[210];
bool cmp(Node a, Node b) { return a.num < b.num; }
bool cmp2(Node a, Node b) { return a.pos < b.pos; }
set<int> s;
int main() {
  scanf("%d", &N);
  for (int i = 0; i < 2 * N; i++) {
    scanf("%d", &node[i].num);
    node[i].pos = i;
  }
  sort(node, node + 2 * N, cmp);
  int cnt = 1;
  int j;
  int num[2] = {0};
  int flag = 0;
  node[2 * N].num = 0;
  for (int i = 1; i <= 2 * N; i++) {
    if (node[i].num == node[i - 1].num)
      cnt++;
    else {
      if (cnt >= 2) {
        int t = (cnt + 1) / 2;
        for (j = i - cnt; j <= i - cnt + t - 1; j++) {
          node[j].flag = flag + 1;
          num[flag]++;
        }
        for (; j <= i - 1; j++) {
          node[j].flag = (flag ^ 1) + 1;
          num[flag ^ 1]++;
        }
      }
      if (cnt % 2 == 1 && cnt != 1) flag ^= 1;
      cnt = 1;
    }
  }
  for (j = 0; j < 2 * N; j++) {
    if (node[j].flag == 0) {
      if (num[0] == N) break;
      node[j].flag = 1;
      num[0]++;
    }
  }
  for (; j < 2 * N; j++) {
    if (node[j].flag == 0) {
      if (num[1] == N) break;
      node[j].flag = 2;
      num[1]++;
    }
  }
  for (int i = 0; i < 2 * N; i++) {
    if (node[i].flag == 1) {
      for (j = 0; j < 2 * N; j++) {
        if (node[j].flag == 2) {
          int tt = node[i].num * 100 + node[j].num;
          s.insert(tt);
        }
      }
    }
  }
  printf("%d\n", s.size());
  sort(node, node + 2 * N, cmp2);
  for (int i = 0; i < 2 * N; i++) {
    printf("%d", node[i].flag);
    if (i == 2 * N - 1)
      printf("\n");
    else
      printf(" ");
  }
}
