#include <bits/stdc++.h>
int Am[100], A[205], Heap[205], N, S[2];
using namespace std;
map<int, int> M[2];
vector<int> Ind[100];
void print() {
  int a = M[0].size(), b = M[1].size();
  if (a < b - 1) a++, b--;
  cout << a * b << "\n";
  for (int i = 0; i < 2 * N; i++) cout << Heap[i] + 1 << " ";
}
void exchange(int x, int y) {
  int n1, n2;
  for (int i = 0; i < 2 * N; i++)
    if (A[i] == x && Heap[i] == 0) {
      n1 = i;
      break;
    }
  for (int i = 0; i < 2 * N; i++)
    if (A[i] == y && Heap[i] == 1) {
      n2 = i;
      break;
    }
  swap(Heap[n1], Heap[n2]);
}
int main() {
  cin >> N;
  for (int i = 0; i < 2 * N; i++) {
    cin >> A[i];
    Am[A[i]]++;
  }
  for (int n = 10; n < 100; n++) {
    if (Am[n] <= 1) continue;
    M[0][n]++;
    M[1][n]++;
    Am[n] -= 2;
    while (Am[n]) M[0][n]++, Am[n]--;
  }
  int h = 0;
  for (int n = 10; n < 100; n++)
    if (Am[n]) {
      M[h][n]++;
      h = 1 - h;
    }
  for (pair<int, int> p : M[0]) S[0] += p.second;
  for (pair<int, int> p : M[1]) S[1] += p.second;
  for (pair<int, int> p : M[0])
    while (S[0] > S[1] && M[0][p.first] > 1) {
      M[0][p.first]--, M[1][p.first]++, S[0]--, S[1]++;
      if (S[0] == S[1]) break;
    }
  cout << M[0].size() * M[1].size() << "\n";
  for (pair<int, int> p : M[0])
    for (int i = 0; i < 2 * N && M[0][p.first] > 0; i++)
      if (A[i] == p.first) Heap[i] = 1, M[0][p.first]--;
  for (int i = 0; i < 2 * N; i++)
    if (Heap[i] == 0)
      cout << "2 ";
    else
      cout << "1 ";
}
