#include <bits/stdc++.h>
using namespace std;
bool vis[100 + 10];
bool vis2[100 + 10];
int pos[200 + 10];
int board[200 + 10];
int g[200 + 10];
int main() {
  int n, m, k, d, tem1, tem2, tem3, sum = 0, ans = 0;
  string s, c;
  cin >> n;
  n *= 2;
  int who = 1, num = 0, num2 = 0, all = 0, all2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> board[i];
    if (!g[board[i]]) {
      g[board[i]]++;
      ans++;
    } else {
      if (g[board[i]] == 1) ans++;
      g[board[i]]++;
    }
  }
  int st = 0, st2 = 0, ch = st;
  for (int i = 10; i <= 99; i++) {
    ch = st;
    who = 1;
    if (g[i] > 1) {
      if (st > st2) {
        ch = st2;
        who = -1;
      }
      for (int j = 0; j < n; j++) {
        if (board[j] == i) {
          if (who == 1) {
            st++;
            pos[j] = 1;
            who *= -1;
          } else {
            st2++;
            pos[j] = 2;
            who *= -1;
          }
        }
      }
    }
  }
  who = 1;
  if (st > st2) who = -1;
  for (int i = 0; i < n; i++) {
    if (g[board[i]] == 1) {
      if (who == 1)
        pos[i] = 1;
      else
        pos[i] = 2;
      who *= -1;
    }
  }
  num = ans / 2;
  if (ans % 2 == 1) num++;
  num2 = ans / 2;
  cout << num * num2 << endl;
  for (int i = 0; i < n; i++) {
    cout << pos[i] << " ";
  }
  return 0;
}
