#include <bits/stdc++.h>
using namespace std;
int p[204];
int occu[204];
int final[204];
int visited[202];
int main() {
  vector<int> a1;
  vector<int> a2;
  int n;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> p[i];
    occu[p[i]]++;
  }
  int t = 1;
  for (int i = 0; i < 2 * n; i++) {
    if (occu[p[i]] == 1) {
      final[i] = t;
      if (t == 1) {
        a1.push_back(p[i]);
        t++;
      } else {
        a2.push_back(p[i]);
        t--;
      }
    }
  }
  int s;
  for (int i = 0; i < 2 * n; i++) {
    if (occu[p[i]] > 1 && visited[i] == 0) {
      for (int j = i; j < 2 * n; j++) {
        if (p[j] == p[i]) {
          final[j] = t;
          if (t == 1) {
            a1.push_back(p[j]);
            t++;
          } else {
            a2.push_back(p[j]);
            t--;
          }
          visited[j] = 1;
        }
      }
    }
  }
  sort(a1.begin(), a1.end());
  a1.erase(unique(a1.begin(), a1.end()), a1.end());
  sort(a2.begin(), a2.end());
  a2.erase(unique(a2.begin(), a2.end()), a2.end());
  cout << a1.size() * a2.size() << "\n";
  for (int i = 0; i < 2 * n; i++) {
    cout << final[i] << " ";
  }
  cout << "\n";
  return 0;
}
