#include <bits/stdc++.h>
using namespace std;
const int maxn = 200 + 10;
int pos[maxn], wheap[maxn];
int cnta[maxn], cntb[maxn];
int nu[maxn];
struct Node {
  int num, cnt;
  bool operator<(const Node &a) const { return cnt > a.cnt; }
};
Node node[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(cnta, 0, sizeof(cnta));
    memset(cntb, 0, sizeof(cntb));
    memset(pos, 0xff, sizeof(pos));
    memset(wheap, 0, sizeof(wheap));
    int tmp, total = 0;
    n *= 2;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &nu[i]);
      tmp = nu[i];
      if (pos[tmp] == -1) {
        node[total].cnt = 1;
        node[total].num = tmp;
        pos[tmp] = total++;
      } else {
        node[pos[tmp]].cnt++;
      }
    }
    sort(node, node + total);
    int heapa = 0, heapb = 0;
    int ca = 0, cb = 0;
    for (int i = 0; i < total; ++i) {
      tmp = node[i].cnt;
      if (tmp % 2 == 0) {
        heapa += tmp / 2;
        heapb += tmp / 2;
        cnta[node[i].num] = tmp / 2;
        cntb[node[i].num] = tmp / 2;
        ca++;
        cb++;
      } else {
        if (heapa > heapb) {
          heapa += tmp / 2;
          heapb += tmp / 2 + 1;
          cnta[node[i].num] = tmp / 2;
          cntb[node[i].num] = tmp / 2 + 1;
          if (tmp == 1)
            cb++;
          else {
            ca++;
            cb++;
          }
        } else {
          heapa += tmp / 2 + 1;
          heapb += tmp / 2;
          cnta[node[i].num] = tmp / 2 + 1;
          cntb[node[i].num] = tmp / 2;
          if (tmp == 1)
            ca++;
          else {
            ca++;
            cb++;
          }
        }
      }
    }
    int sum = 0;
    sum = ca * cb;
    printf("%d\n", sum);
    for (int i = 0; i < n; ++i) {
      if (i) printf(" ");
      if (cnta[nu[i]] > wheap[nu[i]]) {
        wheap[nu[i]]++;
        printf("1");
      } else
        printf("2");
    }
    printf("\n");
  }
  return 0;
}
