#include <bits/stdc++.h>
using namespace std;
const int N = 205;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
int ans[N], n;
vector<int> v[200];
vector<int> vec;
int cnt[3];
int main() {
  scanf("%d", &n);
  int op = 1;
  for (int i = 1; i <= 2 * n; i++) {
    int x;
    scanf("%d", &x);
    v[x].push_back(i);
  }
  for (int i = 10; i <= 99; i++) {
    if (v[i].size() == 0) continue;
    if (v[i].size() == 1) {
      ans[v[i][0]] = op;
      cnt[op]++;
      if (op == 1)
        op = 2;
      else
        op = 1;
    } else {
      ans[v[i][0]] = 1;
      ans[v[i][1]] = 2;
      cnt[1]++;
      cnt[2]++;
      for (int j = 2; j < v[i].size(); j++) vec.push_back(v[i][j]);
    }
  }
  printf("%d\n", cnt[1] * cnt[2]);
  int num = n - cnt[1];
  for (int i : vec) {
    if (num > 0)
      ans[i] = 1;
    else
      ans[i] = 2;
    num--;
  }
  for (int i = 1; i <= 2 * n; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
