#include <bits/stdc++.h>
using namespace std;
int n, a[2000], used[1000], ans[1000], l, x, r, b[10000];
set<int> a1, a2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> b[i];
    a[b[i]]++;
  }
  for (int i = 10; i <= 99; i++)
    if (a[i] >= 2) {
      int t = 2;
      used[i] = 1;
      for (int j = 1; j <= 2 * n && t > 0; j++)
        if (b[j] == i)
          if (t == 2) {
            ans[j] = 1;
            a1.insert(i);
            t--;
            l++;
          } else {
            ans[j] = 2;
            a2.insert(i);
            t--;
            r++;
          }
      a[i] -= 2;
    }
  for (int i = 10; i <= 99; i++)
    if (a[i] == 1 && !used[i])
      for (int j = 1; j <= 2 * n; j++)
        if (b[j] == i)
          if (a1.size() > a2.size()) {
            ans[j] = 2;
            a[i]--;
            used[i] = 1;
            a2.insert(i);
            j = 10 * n;
            r++;
          } else {
            ans[j] = 1;
            a[i]--;
            used[i] = 1;
            a1.insert(i);
            j = 10 * n;
            l++;
          }
  for (int i = 1; i <= 2 * n; i++)
    if (ans[i] == 0) {
      if (l < r) {
        ans[i] = 1;
        l++;
      } else {
        ans[i] = 2;
        r++;
      }
    }
  cout << a1.size() * a2.size() << endl;
  for (int i = 1; i <= 2 * n; i++) cout << ans[i] << " ";
}
