#include <bits/stdc++.h>
using namespace std;
const int N = 210;
const int M = 1000010;
const int inf = 0x3f3f3f3f;
const long long oo = 0x3f3f3f3f3f3f3f3fll;
const int mod = 1e9 + 7;
int n, ans[N];
queue<int> que[N];
set<int> sa, sb;
int main() {
  scanf("%d", &n);
  n += n;
  int ca = 0, cb = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    que[x].push(i);
  }
  for (int i = 10, pre = 0; i <= 99; i++) {
    if (que[i].size() <= 1) continue;
    if (que[i].size() & 1) {
      int t = que[i].front();
      que[i].pop();
      if (pre == 0) {
        ans[t] = 1;
        ca++;
        sa.insert(i);
      } else
        ans[t] = 2, cb++, sb.insert(i);
      pre ^= 1;
    }
    while (que[i].size()) {
      int u = que[i].front();
      que[i].pop();
      if (ca <= cb) {
        ans[u] = 1;
        sa.insert(i);
        ca++;
      } else {
        ans[u] = 2;
        sb.insert(i);
        cb++;
      }
    }
  }
  for (int i = 10; i <= 99; i++) {
    while (que[i].size()) {
      int u = que[i].front();
      que[i].pop();
      if (ca <= cb) {
        ans[u] = 1;
        sa.insert(i);
        ca++;
      } else {
        ans[u] = 2;
        sb.insert(i);
        cb++;
      }
    }
  }
  cout << ((sa).size()) * ((sb).size()) << endl;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
