#include <bits/stdc++.h>
using namespace std;
int cnt1[110], cnt2[110], pl[110];
;
vector<int> v;
int ans[410];
int a[410];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> a[i];
    cnt1[a[i]]++;
    pl[a[i]] = i;
  }
  int h1 = 0, h2 = 0;
  for (int i = 0; i < 2 * n; i++) {
    cnt2[a[i]]++;
    if (cnt1[a[i]] == 1)
      v.push_back(a[i]);
    else if (cnt2[a[i]] == 1) {
      h1++;
      ans[i] = 1;
    } else if (cnt2[a[i]] == 2) {
      h2++;
      ans[i] = 2;
    }
  }
  for (int i = 0; i < v.size(); i++)
    if (i < v.size() / 2) {
      ans[pl[v[i]]] = 1;
      h1++;
    } else {
      ans[pl[v[i]]] = 2;
      h2++;
    }
  cout << h1 * h2 << endl;
  for (int i = 0; i < 2 * n; i++)
    if (ans[i] == 0)
      if (h1 < n) {
        h1++;
        cout << 1 << " ";
      } else
        cout << 2 << " ";
    else
      cout << ans[i] << " ";
  cout << endl;
}
