#include <bits/stdc++.h>
using namespace std;
int n, id = 1;
int a[202], b[202];
vector<int> pos[202];
set<int> s;
int main() {
  int i, j;
  cin >> n;
  n <<= 1;
  for (i = 1; i <= n; ++i) {
    cin >> a[i];
    pos[a[i]].push_back(i);
  }
  for (i = 10; i <= 99; ++i) {
    if (pos[i].size() == 1) b[pos[i][0]] = 2 - ((++id) & 1);
  }
  for (i = 10; i <= 99; ++i) {
    if (pos[i].size() > 1) {
      for (j = 0; j < pos[i].size(); ++j) b[pos[i][j]] = 2 - ((++id) & 1);
    }
  }
  for (i = 1; i <= n; ++i) {
    if (b[i] == 2) {
      for (j = 1; j <= n; ++j) {
        if (b[j] == 1) s.insert(a[i] * 100 + a[j]);
      }
    }
  }
  cout << s.size() << endl;
  for (i = 1; i <= n; ++i) cout << b[i] << " ";
  return 0;
}
