#include <bits/stdc++.h>
using namespace std;
int arr[205], sol[205], freq[105];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> arr[i];
    freq[arr[i]]++;
  }
  memset(sol, -1, sizeof sol);
  int sz1 = 0, sz2 = 0;
  for (int i = 10, in = 0; i <= 99; i++) {
    if (freq[i] == 1) {
      in++;
      for (int idx = 1; idx <= 2 * n; idx++) {
        if (arr[idx] == i) {
          if (in & 1)
            sol[idx] = 1, sz1++;
          else
            sol[idx] = 2, sz2++;
        }
      }
    }
  }
  for (int i = 10; i <= 99; i++) {
    if (freq[i] > 1) {
      int in = 1;
      for (int idx = 1; idx <= 2 * n; idx++) {
        if (arr[idx] == i) {
          if (in == 1)
            sol[idx] = 1, sz1++;
          else if (in == 2)
            sol[idx] = 2, sz2++;
          else {
            if (sz1 <= sz2)
              sol[idx] = 1, sz1++;
            else
              sol[idx] = 2, sz2++;
          }
          in++;
        }
      }
    }
  }
  set<int> s1, s2;
  for (int i = 1; i <= 2 * n; i++)
    if (sol[i] == 1)
      s1.insert(arr[i]);
    else
      s2.insert(arr[i]);
  cout << s1.size() * s2.size() << '\n';
  for (int i = 1; i <= 2 * n; i++) cout << sol[i] << ' ';
  return 0;
}
