#include <bits/stdc++.h>
using namespace std;
int a[410];
int num[110];
int b[410];
struct Node {
  int v, index;
} node[410];
bool cmp(Node t1, Node t2) { return t1.v < t2.v; }
int p1[210], p2[210];
vector<int> vec[110];
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i <= 100; i++) vec[i].clear();
    for (int i = 0; i < 2 * n; i++) scanf("%d", &a[i]);
    for (int i = 0; i < 2 * n; i++) {
      node[i].v = a[i];
      node[i].index = i;
      vec[a[i]].push_back(i);
    }
    int now = 0;
    for (int i = 10; i < 100; i++) {
      int sz = min(2, (int)vec[i].size());
      for (int j = 0; j < sz; j++) {
        b[vec[i].back()] = now;
        now ^= 1;
        vec[i].pop_back();
      }
    }
    for (int i = 10; i < 100; i++) {
      int sz = vec[i].size();
      for (int j = 0; j < sz; j++) {
        b[vec[i].back()] = now;
        now ^= 1;
        vec[i].pop_back();
      }
    }
    set<int> st[2];
    for (int i = 0; i < 2 * n; i++) {
      st[b[i]].insert(a[i]);
    }
    printf("%d\n", st[0].size() * st[1].size());
    for (int i = 0; i < 2 * n; i++) {
      if (b[i] == 0)
        printf("1");
      else
        printf("2");
      if (i < 2 * n - 1)
        printf(" ");
      else
        printf("\n");
    }
    continue;
    sort(node, node + 2 * n, cmp);
    int cnt1 = 0, cnt2 = 0;
    for (int i = 0; i < 2 * n; i++) {
      if (i % 2 == 0) {
        b[node[i].index] = 0;
        p1[cnt1++] = node[i].v;
      } else {
        b[node[i].index] = 1;
        p2[cnt2++] = node[i].v;
      }
    }
    cnt1 = unique(p1, p1 + cnt1) - p1;
    cnt2 = unique(p2, p2 + cnt2) - p2;
    printf("%d\n", cnt1 * cnt2);
    for (int i = 0; i < 2 * n; i++) {
      if (b[i] == 0)
        printf("1");
      else
        printf("2");
      if (i < 2 * n - 1)
        printf(" ");
      else
        printf("\n");
    }
    continue;
    memset(num, 0, sizeof(num));
    for (int i = 0; i < 2 * n; i++) num[a[i]]++;
    int ff = 0;
    for (int i = 10; i <= 99; i++) {
      if (num[i] == 0) continue;
      if (num[i] % 2 == 0) {
        int cnt = num[i] / 2;
        int cc = 0;
        for (int j = 0; j < 2 * n; j++)
          if (a[j] == i) {
            if (cc < cnt)
              b[j] = 0;
            else
              b[j] = 1;
            cc++;
          }
        continue;
      }
      int cnt = num[i] / 2;
      int cc = 0;
      for (int j = 0; j < 2 * n; j++)
        if (a[j] == i) {
          if (cc == num[i] - 1) {
            b[j] = ff;
            continue;
          }
          if (cc < cnt)
            b[j] = 0;
          else
            b[j] = 1;
          cc++;
        }
      ff ^= 1;
    }
    int num1 = 0;
    memset(num, 0, sizeof(num));
    for (int i = 0; i < 2 * n; i++)
      if (b[i] == 0) num[a[i]]++;
    for (int i = 10; i < 100; i++)
      if (num[i]) num1++;
    int num2 = 0;
    memset(num, 0, sizeof(num));
    for (int i = 0; i < 2 * n; i++)
      if (b[i] == 1) num[a[i]]++;
    for (int i = 10; i < 100; i++)
      if (num[i]) num2++;
    printf("%d\n", num1 * num2);
    for (int i = 0; i < 2 * n; i++) {
      if (b[i] == 0)
        printf("1");
      else
        printf("2");
      if (i < 2 * n - 1)
        printf(" ");
      else
        printf("\n");
    }
  }
  return 0;
}
