#include <bits/stdc++.h>
using namespace std;
template <class T>
void dbs(string str, T t) {
  cerr << str << " : " << t << "\n";
}
template <class T, class... S>
void dbs(string str, T t, S... s) {
  int idx = str.find(',');
  cerr << str.substr(0, idx) << " : " << t << ",";
  dbs(str.substr(idx + 1), s...);
}
const int N = 222;
int a[N];
int p[N];
vector<int> indices[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  n <<= 1;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    indices[p[i]].push_back(i);
  }
  int par = 0;
  for (int i = 10; i <= 99; ++i)
    if (!indices[i].empty()) {
      a[indices[i].back()] = par;
      par ^= 1;
      indices[i].pop_back();
      if (!indices[i].empty()) {
        a[indices[i].back()] = par;
        indices[i].pop_back();
        par ^= 1;
      }
    }
  for (int i = 10; i <= 99; ++i) {
    while (!indices[i].empty()) {
      a[indices[i].back()] = par;
      indices[i].pop_back();
      par ^= 1;
    }
  }
  set<int> s;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i] == 0 and a[j] == 1) {
        s.insert(p[i] * 100 + p[j]);
      }
    }
  }
  cout << s.size() << "\n";
  for (int i = 0; i < n; ++i) {
    cout << a[i] + 1 << " ";
  }
  cout << "\n";
  return 0;
}
