#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[201], freq[100], d = 0, now = 0, pos[100][200], ans[201], one[101],
                            two[101];
  memset(freq, 0, sizeof(freq));
  cin >> n;
  for (int i = 1; i <= n * 2; i++) {
    cin >> a[i];
    pos[a[i]][freq[a[i]]] = i;
    freq[a[i]]++;
  }
  for (int i = 10; i <= 99; i++) {
    if (freq[i] <= 1) continue;
    for (int j = 0; j < freq[i]; j++) {
      ans[pos[i][j]] = now + 1;
      now = (now + 1) % 2;
    }
  }
  for (int i = 10; i <= 99; i++) {
    if (freq[i] > 1) continue;
    for (int j = 0; j < freq[i]; j++) {
      ans[pos[i][j]] = now + 1;
      now = (now + 1) % 2;
    }
  }
  int c1 = 0, c2 = 0;
  bool isExist;
  for (int i = 1; i <= n * 2; i++) {
    isExist = false;
    if (ans[i] == 1) {
      for (int j = 0; j < c1; j++)
        if (one[j] == a[i]) {
          isExist = true;
          break;
        }
      if (!isExist) one[c1++] = a[i];
    } else {
      for (int j = 0; j < c2; j++)
        if (two[j] == a[i]) {
          isExist = true;
          break;
        }
      if (!isExist) two[c2++] = a[i];
    }
  }
  cout << c1 * c2 << endl;
  for (int i = 1; i < n * 2; i++) cout << ans[i] << " ";
  cout << ans[n * 2] << endl;
  return 0;
}
