#include <bits/stdc++.h>
using namespace std;
bool output[200];
bool sw = false;
unsigned int n, buff;
vector<int> a[100];
unsigned int f(0), s(0);
void put(unsigned int x) {
  output[x] = sw;
  sw = !sw;
}
int main() {
  cin >> n;
  n = n << 1;
  for (unsigned int i(0); i != n; ++i) {
    cin >> buff;
    a[buff].push_back(i);
  }
  for (unsigned int i(0); i != 100; ++i) {
    if (a[i].size() == 1) {
      if (sw)
        ++s;
      else
        ++f;
      put(a[i][0]);
    }
  }
  for (unsigned int i(0); i != 100; ++i) {
    if (a[i].size() > 1) {
      ++s;
      ++f;
      for (auto j = a[i].begin(); j != a[i].end(); ++j) {
        put(*j);
      }
    }
  }
  cout << s * f << endl;
  for (unsigned int i(0); i != n; ++i) {
    if (output[i])
      cout << 2;
    else
      cout << 1;
    cout << " ";
  }
  return 0;
}
