#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int dr8[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dc8[] = {1, -1, 0, 0, -1, 1, -1, 1};
int dr4[] = {0, 1, -1, 0};
int dc4[] = {1, 0, 0, -1};
int freq[100];
pair<int, int> heap[100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(2 * n);
  for (int i = 0; i < 2 * n; i++) {
    cin >> v[i];
    freq[v[i]]++;
  }
  int g1 = 0;
  int g2 = 0;
  int b1 = 0;
  int b2 = 0;
  for (int i = 0; i < 100; i++) {
    if (freq[i] == 1) {
      if (g1 < g2) {
        heap[i].first++;
        g1++;
      } else {
        heap[i].second++;
        g2++;
      }
    }
    if (freq[i] >= 2) {
      heap[i].first = heap[i].second = 1;
      g1++;
      g2++;
    }
    if (freq[i] > 2) {
      freq[i] = freq[i] - 2;
      while (freq[i]-- > 0) {
        if (b1 <= b2) {
          heap[i].first++;
          b1++;
        } else {
          heap[i].second++;
          b2++;
        }
      }
    }
  }
  cout << g1 * g2 << "\n";
  for (int i = 0; i < 2 * n; i++) {
    if (heap[v[i]].first > 0) {
      cout << "1"
           << " ";
      heap[v[i]].first--;
    } else
      cout << "2"
           << " ";
  }
  return 0;
}
