#include <bits/stdc++.h>
using namespace std;
const int NS = 210;
vector<int> s[NS];
int n;
int a[NS][3], b[NS];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < NS; i++) s[i].clear(), a[i][2] = a[i][1] = 0, b[i] = -1;
    for (int i = 0; i < n * 2; i++) {
      int x;
      scanf("%d", &x);
      s[x].push_back(i);
    }
    int flag = 1;
    for (int i = 10; i < 100; i++) {
      int sz = s[i].size();
      while (sz > 2) {
        sz--;
        s[0].push_back(s[i][sz]);
        s[1].push_back(i);
      }
      for (int j = 0; j < sz; j++) {
        a[i][flag]++;
        b[s[i][j]] = flag;
        flag = 3 - flag;
      }
    }
    int sz = s[0].size();
    for (int i = 0; i < sz; i++) {
      a[s[1][i]][flag]++;
      b[s[0][i]] = flag;
      flag = 3 - flag;
    }
    int x = 0, y = 0;
    for (int i = 10; i < 100; i++) {
      if (a[i][2]) x++;
      if (a[i][1]) y++;
    }
    printf("%d\n", x * y);
    for (int i = 0; i < n * 2; i++) printf("%d ", b[i]);
    puts("");
  }
  return 0;
}
