#include <bits/stdc++.h>
using namespace std;
const int N = 210;
int n, sum[2];
vector<int> rep[N];
bool mark[N], p;
int main() {
  cin >> n;
  for (int i = 0, j; i < 2 * n; i++) cin >> j, rep[j].push_back(i);
  for (int i = 10; i < 100; i++)
    if (rep[i].size() > 1)
      for (int j = 0; j < 2; j++) {
        mark[rep[i].back()] = j;
        rep[i].pop_back();
        sum[j]++;
      }
    else if (rep[i].size() == 1) {
      mark[rep[i][0]] = p, sum[p]++, p = !p;
      rep[i].pop_back();
    }
  cout << sum[0] * sum[1] << '\n';
  for (int i = 10; i < 100; i++)
    while (!rep[i].empty()) {
      mark[rep[i].back()] = (sum[1]++ < n);
      rep[i].pop_back();
    }
  for (int i = 0; i < 2 * n; i++) cout << mark[i] + 1 << ' ';
  cout << '\n';
  return 0;
}
