#include <bits/stdc++.h>
using namespace std;
struct node {
  int val;
  int pos;
  int cnt;
};
node ab;
set<int> s1, s2;
vector<node> use;
int arr[202], cnt[102];
bool compare(node a, node b) { return (a.val < b.val); }
bool compare2(node a, node b) { return (a.cnt < b.cnt); }
int main() {
  vector<node>::iterator it;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; i++) {
    scanf("%d", &arr[i]);
    cnt[arr[i]]++;
  }
  for (int i = 0; i < 2 * n; i++) {
    ab.cnt = cnt[arr[i]];
    ab.pos = i;
    ab.val = arr[i];
    use.push_back(ab);
  }
  sort(use.begin(), use.end(), compare);
  stable_sort(use.begin(), use.end(), compare2);
  for (it = use.begin(); it != use.end(); it++) {
    ab = *it;
    arr[ab.pos] = 1;
    s1.insert(ab.val);
    it++;
    ab = *it;
    s2.insert(ab.val);
    arr[ab.pos] = 2;
  }
  printf("%d\n", s1.size() * s2.size());
  for (int i = 0; i < 2 * n; i++) printf("%d ", arr[i]);
  return 0;
}
