#include <bits/stdc++.h>
using namespace std;
int arr[205];
int pos[205];
std::vector<pair<long long int, long long int> > dob;
std::vector<pair<long long int, long long int> > one;
std::vector<int> st1, st2;
int cnt[205];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> arr[i];
    cnt[arr[i]]++;
  }
  for (int i = 1; i <= 2 * n; i++) {
    if (cnt[arr[i]] > 1)
      dob.push_back(make_pair(arr[i], i));
    else
      one.push_back(make_pair(arr[i], i));
  }
  sort(dob.begin(), dob.end());
  for (auto x : dob) {
    if (st1.size() > st2.size()) {
      st2.push_back(x.first);
      pos[x.second] = 2;
    } else {
      st1.push_back(x.first);
      pos[x.second] = 1;
    }
  }
  for (auto x : one) {
    if (st1.size() > st2.size()) {
      st2.push_back(x.first);
      pos[x.second] = 2;
    } else {
      st1.push_back(x.first);
      pos[x.second] = 1;
    }
  }
  sort(st1.begin(), st1.end());
  sort(st2.begin(), st2.end());
  st1.resize(unique(st1.begin(), st1.end()) - st1.begin());
  st2.resize(unique(st2.begin(), st2.end()) - st2.begin());
  cout << st1.size() * st2.size() << endl;
  for (int i = 1; i <= 2 * n; i++) {
    cout << pos[i] << " ";
  }
  return 0;
}
