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